pycistem 0.6.1__cp310-cp310-manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycistem/__init__.py +9 -0
- pycistem/config.py +20 -0
- pycistem/core/__init__.py +1 -0
- pycistem/core/core.cpp +1070 -0
- pycistem/core/core.cpython-310-x86_64-linux-gnu.so +0 -0
- pycistem/core/database.cpp +408 -0
- pycistem/core/euler_search.cpp +72 -0
- pycistem/core/run_profiles.cpp +114 -0
- pycistem/database/__init__.py +301 -0
- pycistem/programs/__init__.py +10 -0
- pycistem/programs/_cistem_constants.py +23 -0
- pycistem/programs/apply_ctf.py +59 -0
- pycistem/programs/cistem_program.py +277 -0
- pycistem/programs/ctffind.py +254 -0
- pycistem/programs/estimate_beamtilt.py +60 -0
- pycistem/programs/match_template.py +325 -0
- pycistem/programs/reconstruct3d.py +79 -0
- pycistem/programs/refine_ctf.py +106 -0
- pycistem/programs/refine_template.py +157 -0
- pycistem/programs/refine_template_dev.py +35 -0
- pycistem/programs/refine_template_niko.py +124 -0
- pycistem/programs/resample.py +30 -0
- pycistem/programs/run_profile.py +17 -0
- pycistem/programs/unblur.py +247 -0
- pycistem/programs/unblur_patch.py +204 -0
- pycistem/utils/__init__.py +1 -0
- pycistem/utils/extract_particles.py +36 -0
- pycistem/utils/move_class_into_unbinned_particle_stack.py +34 -0
- pycistem/utils/order_by_class_occupancy.py +26 -0
- pycistem/utils/plot_class_occupancy.py +51 -0
- pycistem/utils/plot_classification_fsc_movie.py +90 -0
- pycistem/utils/plot_occupancy_by_condition.py +129 -0
- pycistem-0.6.1.dist-info/METADATA +258 -0
- pycistem-0.6.1.dist-info/RECORD +84 -0
- pycistem-0.6.1.dist-info/WHEEL +5 -0
- pycistem-0.6.1.dist-info/licenses/LICENSE +201 -0
- pycistem-0.6.1.dist-info/sboms/auditwheel.cdx.json +1 -0
- pycistem.libs/libXau-154567c4.so.6.0.0 +0 -0
- pycistem.libs/libXcomposite-9a78b2b5.so.1.0.0 +0 -0
- pycistem.libs/libXcursor-557eab0f.so.1.0.2 +0 -0
- pycistem.libs/libXdamage-45f20f14.so.1.1.0 +0 -0
- pycistem.libs/libXfixes-e3b7d94c.so.3.1.0 +0 -0
- pycistem.libs/libXi-9178a6bd.so.6.1.0 +0 -0
- pycistem.libs/libXinerama-6a3f4a3e.so.1.0.0 +0 -0
- pycistem.libs/libXrandr-9f75043e.so.2.2.0 +0 -0
- pycistem.libs/libatk-1-3e086f29.0.so.0.22810.1 +0 -0
- pycistem.libs/libblkid-a9167753.so.1.1.0 +0 -0
- pycistem.libs/libbz2-a1e77c99.so.1.0.6 +0 -0
- pycistem.libs/libcairo-dfbea965.so.2.11512.0 +0 -0
- pycistem.libs/libdatrie-584ecbbd.so.1.3.2 +0 -0
- pycistem.libs/libffi-3a37023a.so.6.0.2 +0 -0
- pycistem.libs/libfontconfig-dcb2ce6c.so.1.12.0 +0 -0
- pycistem.libs/libfreetype-2f3b32b6.so.6.16.1 +0 -0
- pycistem.libs/libfribidi-a2ddad26.so.0.4.0 +0 -0
- pycistem.libs/libgdk-x11-2-ae2f4865.0.so.0.2400.32 +0 -0
- pycistem.libs/libgdk_pixbuf-2-e875edac.0.so.0.3612.0 +0 -0
- pycistem.libs/libgio-2-54f4f0a9.0.so.0.5600.4 +0 -0
- pycistem.libs/libgmodule-2-a8eef785.0.so.0.5600.4 +0 -0
- pycistem.libs/libgmp-d944b113.so.10.3.2 +0 -0
- pycistem.libs/libgnutls-e5fc1c5f.so.30.28.2 +0 -0
- pycistem.libs/libgomp-e985bcbb.so.1.0.0 +0 -0
- pycistem.libs/libgraphite2-a2b39163.so.3.0.1 +0 -0
- pycistem.libs/libgtk-x11-2-76f42ab1.0.so.0.2400.32 +0 -0
- pycistem.libs/libharfbuzz-26b3d829.so.0.10705.0 +0 -0
- pycistem.libs/libhogweed-cd4c53be.so.4.5 +0 -0
- pycistem.libs/libidn2-2f4a5893.so.0.3.6 +0 -0
- pycistem.libs/libmount-ec61bd71.so.1.1.0 +0 -0
- pycistem.libs/libnettle-37944285.so.6.5 +0 -0
- pycistem.libs/libp11-kit-ac9dcd7e.so.0.3.0 +0 -0
- pycistem.libs/libpango-1-e80d1584.0.so.0.4200.3 +0 -0
- pycistem.libs/libpangocairo-1-e0e0fbcf.0.so.0.4200.3 +0 -0
- pycistem.libs/libpangoft2-1-1fa1613e.0.so.0.4200.3 +0 -0
- pycistem.libs/libpcre-0dd207b5.so.1.2.10 +0 -0
- pycistem.libs/libpcre2-8-516f4c9d.so.0.7.1 +0 -0
- pycistem.libs/libpixman-1-06469c37.so.0.38.4 +0 -0
- pycistem.libs/libpng16-748299c7.so.16.34.0 +0 -0
- pycistem.libs/libselinux-d0805dcb.so.1 +0 -0
- pycistem.libs/libtasn1-564de53e.so.6.5.5 +0 -0
- pycistem.libs/libthai-cd935638.so.0.3.0 +0 -0
- pycistem.libs/libunistring-05abdd40.so.2.1.0 +0 -0
- pycistem.libs/libuuid-95b83d40.so.1.3.0 +0 -0
- pycistem.libs/libxcb-5ddf6756.so.1.1.0 +0 -0
- pycistem.libs/libxcb-render-161c0eb5.so.0.0.0 +0 -0
- pycistem.libs/libxcb-shm-0be6dfbf.so.0.0.0 +0 -0
pycistem/core/core.cpp
ADDED
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
#include <pybind11/pybind11.h>
|
|
2
|
+
#include <pybind11/numpy.h>
|
|
3
|
+
#include "core/core_headers.h"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#define STRINGIFY(x) #x
|
|
8
|
+
#define MACRO_STRINGIFY(x) STRINGIFY(x)
|
|
9
|
+
|
|
10
|
+
namespace py = pybind11;
|
|
11
|
+
|
|
12
|
+
void init_database(py::module &);
|
|
13
|
+
void init_run_profiles(py::module &);
|
|
14
|
+
void init_euler(py::module &);
|
|
15
|
+
|
|
16
|
+
PYBIND11_MODULE(core, m)
|
|
17
|
+
{
|
|
18
|
+
m.doc() = R"pbdoc(
|
|
19
|
+
CisTEM core library
|
|
20
|
+
-----------------------
|
|
21
|
+
|
|
22
|
+
.. currentmodule:: core
|
|
23
|
+
|
|
24
|
+
.. autosummary::
|
|
25
|
+
:toctree: _generate
|
|
26
|
+
|
|
27
|
+
Image
|
|
28
|
+
)pbdoc";
|
|
29
|
+
|
|
30
|
+
// Global Functions
|
|
31
|
+
|
|
32
|
+
m.def(
|
|
33
|
+
"GetMRCDetails", [](const char *filename)
|
|
34
|
+
{
|
|
35
|
+
int x_size;
|
|
36
|
+
int y_size;
|
|
37
|
+
int number_of_images;
|
|
38
|
+
auto __ret = GetMRCDetails(filename, x_size, y_size, number_of_images);
|
|
39
|
+
return std::make_tuple(__ret, x_size, y_size, number_of_images);
|
|
40
|
+
},
|
|
41
|
+
"A function which details an mrc?");
|
|
42
|
+
|
|
43
|
+
// Angles and Shifts
|
|
44
|
+
|
|
45
|
+
py::class_<AnglesAndShifts> anglesandshifts(m, "AnglesAndShifts");
|
|
46
|
+
anglesandshifts
|
|
47
|
+
.def(py::init<>())
|
|
48
|
+
.def(py::init<float,float,float,float,float>())
|
|
49
|
+
.def("GenerateEulerMatrices", &AnglesAndShifts::GenerateEulerMatrices)
|
|
50
|
+
.def("GenerateRotationMatrix2D", &AnglesAndShifts::GenerateRotationMatrix2D)
|
|
51
|
+
.def("Init", &AnglesAndShifts::Init)
|
|
52
|
+
.def("ReturnPhiAngle", &AnglesAndShifts::ReturnPhiAngle)
|
|
53
|
+
.def("ReturnThetaAngle", &AnglesAndShifts::ReturnThetaAngle)
|
|
54
|
+
.def("ReturnPsiAngle", &AnglesAndShifts::ReturnPsiAngle)
|
|
55
|
+
.def("ReturnShiftX", &AnglesAndShifts::ReturnShiftX)
|
|
56
|
+
.def("ReturnShiftY", &AnglesAndShifts::ReturnShiftY);
|
|
57
|
+
|
|
58
|
+
// Asset classes
|
|
59
|
+
|
|
60
|
+
py::class_<Asset> asset(m, "Asset");
|
|
61
|
+
asset
|
|
62
|
+
.def(py::init<>())
|
|
63
|
+
.def("ReturnFullPathString", &Asset::ReturnFullPathString)
|
|
64
|
+
.def("ReturnShortNameString", &Asset::ReturnShortNameString);
|
|
65
|
+
|
|
66
|
+
py::class_<MovieAsset> movieasset(m, "MovieAsset");
|
|
67
|
+
movieasset
|
|
68
|
+
.def(py::init<>())
|
|
69
|
+
.def(py::init<wxString>())
|
|
70
|
+
.def("Update", &MovieAsset::Update)
|
|
71
|
+
.def("CopyFrom", &MovieAsset::CopyFrom);
|
|
72
|
+
|
|
73
|
+
py::class_<MovieMetadataAsset> moviemetadataasset(m, "MovieMetadataAsset");
|
|
74
|
+
moviemetadataasset
|
|
75
|
+
.def(py::init<>());
|
|
76
|
+
|
|
77
|
+
py::class_<ImageAsset> imageasset(m, "ImageAsset");
|
|
78
|
+
imageasset
|
|
79
|
+
.def(py::init<>())
|
|
80
|
+
.def(py::init<wxString>())
|
|
81
|
+
.def("Update", &ImageAsset::Update)
|
|
82
|
+
.def("CopyFrom", &ImageAsset::CopyFrom);
|
|
83
|
+
|
|
84
|
+
py::class_<ParticlePositionAsset> particlepositionasset(m, "ParticlePositionAsset");
|
|
85
|
+
particlepositionasset
|
|
86
|
+
.def(py::init<>())
|
|
87
|
+
.def(py::init<float, float>())
|
|
88
|
+
.def("Reset", &ParticlePositionAsset::Reset)
|
|
89
|
+
.def("CopyFrom", &ParticlePositionAsset::CopyFrom);
|
|
90
|
+
|
|
91
|
+
py::class_<VolumeAsset> volumeasset(m, "VolumeAsset");
|
|
92
|
+
volumeasset
|
|
93
|
+
.def(py::init<>())
|
|
94
|
+
.def(py::init<wxString>())
|
|
95
|
+
.def("Update", &VolumeAsset::Update)
|
|
96
|
+
.def("CopyFrom", &VolumeAsset::CopyFrom);
|
|
97
|
+
|
|
98
|
+
py::class_<AtomicCoordinatesAsset> atomiccoordinatesasset(m, "AtomicCoordinatesAsset");
|
|
99
|
+
atomiccoordinatesasset
|
|
100
|
+
.def(py::init<>())
|
|
101
|
+
.def(py::init<wxString>())
|
|
102
|
+
.def("Update", &AtomicCoordinatesAsset::Update)
|
|
103
|
+
.def("CopyFrom", &AtomicCoordinatesAsset::CopyFrom);
|
|
104
|
+
|
|
105
|
+
py::class_<MovieAssetList> movieassetlist(m, "MovieAssetList");
|
|
106
|
+
movieassetlist
|
|
107
|
+
.def(py::init<>())
|
|
108
|
+
.def("ReturnAssetPointer", &MovieAssetList::ReturnAssetPointer)
|
|
109
|
+
.def("ReturnMovieAssetPointer", &MovieAssetList::ReturnMovieAssetPointer)
|
|
110
|
+
.def("ReturnAssetID", &MovieAssetList::ReturnAssetID)
|
|
111
|
+
.def("ReturnParentAssetID", &MovieAssetList::ReturnParentAssetID)
|
|
112
|
+
.def("ReturnAssetName", &MovieAssetList::ReturnAssetName)
|
|
113
|
+
.def("ReturnArrayPositionFromID", &MovieAssetList::ReturnArrayPositionFromID)
|
|
114
|
+
.def("ReturnArrayPositionFromParentID", &MovieAssetList::ReturnArrayPositionFromParentID)
|
|
115
|
+
.def("ReturnAssetFullFilename", &MovieAssetList::ReturnAssetFullFilename)
|
|
116
|
+
.def("AddAsset", &MovieAssetList::AddAsset)
|
|
117
|
+
.def("RemoveAsset", &MovieAssetList::RemoveAsset)
|
|
118
|
+
.def("RemoveAll", &MovieAssetList::RemoveAll)
|
|
119
|
+
.def("FindFile", &MovieAssetList::FindFile)
|
|
120
|
+
.def("CheckMemory", &MovieAssetList::CheckMemory);
|
|
121
|
+
|
|
122
|
+
py::class_<ImageAssetList> imageassetlist(m, "ImageAssetList");
|
|
123
|
+
imageassetlist
|
|
124
|
+
.def(py::init<>())
|
|
125
|
+
.def("ReturnAssetPointer", &ImageAssetList::ReturnAssetPointer)
|
|
126
|
+
.def("ReturnImageAssetPointer", &ImageAssetList::ReturnImageAssetPointer)
|
|
127
|
+
.def("ReturnAssetID", &ImageAssetList::ReturnAssetID)
|
|
128
|
+
.def("ReturnParentAssetID", &ImageAssetList::ReturnParentAssetID)
|
|
129
|
+
.def("ReturnAssetName", &ImageAssetList::ReturnAssetName)
|
|
130
|
+
.def("ReturnArrayPositionFromID", &ImageAssetList::ReturnArrayPositionFromID)
|
|
131
|
+
.def("ReturnArrayPositionFromParentID", &ImageAssetList::ReturnArrayPositionFromParentID)
|
|
132
|
+
.def("ReturnAssetFullFilename", &ImageAssetList::ReturnAssetFullFilename)
|
|
133
|
+
.def("AddAsset", &ImageAssetList::AddAsset)
|
|
134
|
+
.def("RemoveAsset", &ImageAssetList::RemoveAsset)
|
|
135
|
+
.def("RemoveAll", &ImageAssetList::RemoveAll)
|
|
136
|
+
.def("FindFile", &ImageAssetList::FindFile)
|
|
137
|
+
.def("CheckMemory", &ImageAssetList::CheckMemory);
|
|
138
|
+
|
|
139
|
+
py::class_<ParticlePositionAssetList> particlepositionassetlist(m, "ParticlePositionAssetList");
|
|
140
|
+
particlepositionassetlist
|
|
141
|
+
.def(py::init<>())
|
|
142
|
+
.def("ReturnAssetPointer", &ParticlePositionAssetList::ReturnAssetPointer)
|
|
143
|
+
.def("ReturnParticlePositionAssetPointer", &ParticlePositionAssetList::ReturnParticlePositionAssetPointer)
|
|
144
|
+
.def("ReturnAssetID", &ParticlePositionAssetList::ReturnAssetID)
|
|
145
|
+
.def("ReturnParentAssetID", &ParticlePositionAssetList::ReturnParentAssetID)
|
|
146
|
+
.def("ReturnAssetName", &ParticlePositionAssetList::ReturnAssetName)
|
|
147
|
+
.def("ReturnAssetFullFilename", &ParticlePositionAssetList::ReturnAssetFullFilename)
|
|
148
|
+
.def("ReturnArrayPositionFromID", &ParticlePositionAssetList::ReturnArrayPositionFromID)
|
|
149
|
+
.def("ReturnArrayPositionFromParentID", &ParticlePositionAssetList::ReturnArrayPositionFromParentID)
|
|
150
|
+
.def("AddAsset", &ParticlePositionAssetList::AddAsset)
|
|
151
|
+
.def("RemoveAsset", &ParticlePositionAssetList::RemoveAsset)
|
|
152
|
+
.def("RemoveAssetsWithGivenParentImageID", &ParticlePositionAssetList::RemoveAssetsWithGivenParentImageID)
|
|
153
|
+
.def("RemoveAll", &ParticlePositionAssetList::RemoveAll)
|
|
154
|
+
.def("CheckMemory", &ParticlePositionAssetList::CheckMemory);
|
|
155
|
+
|
|
156
|
+
py::class_<VolumeAssetList> volumeassetlist(m, "VolumeAssetList");
|
|
157
|
+
volumeassetlist
|
|
158
|
+
.def(py::init<>())
|
|
159
|
+
.def("ReturnAssetPointer", &VolumeAssetList::ReturnAssetPointer)
|
|
160
|
+
.def("ReturnVolumeAssetPointer", &VolumeAssetList::ReturnVolumeAssetPointer)
|
|
161
|
+
.def("ReturnAssetID", &VolumeAssetList::ReturnAssetID)
|
|
162
|
+
.def("ReturnParentAssetID", &VolumeAssetList::ReturnParentAssetID)
|
|
163
|
+
.def("ReturnAssetName", &VolumeAssetList::ReturnAssetName)
|
|
164
|
+
.def("ReturnArrayPositionFromID", &VolumeAssetList::ReturnArrayPositionFromID)
|
|
165
|
+
.def("ReturnArrayPositionFromParentID", &VolumeAssetList::ReturnArrayPositionFromParentID)
|
|
166
|
+
.def("ReturnAssetFullFilename", &VolumeAssetList::ReturnAssetFullFilename)
|
|
167
|
+
.def("AddAsset", &VolumeAssetList::AddAsset)
|
|
168
|
+
.def("RemoveAsset", &VolumeAssetList::RemoveAsset)
|
|
169
|
+
.def("RemoveAll", &VolumeAssetList::RemoveAll)
|
|
170
|
+
.def("FindFile", &VolumeAssetList::FindFile)
|
|
171
|
+
.def("CheckMemory", &VolumeAssetList::CheckMemory);
|
|
172
|
+
|
|
173
|
+
py::class_<AtomicCoordinatesAssetList> atomiccoordinatesassetlist(m, "AtomicCoordinatesAssetList");
|
|
174
|
+
atomiccoordinatesassetlist
|
|
175
|
+
.def(py::init<>())
|
|
176
|
+
.def("ReturnAssetPointer", &AtomicCoordinatesAssetList::ReturnAssetPointer)
|
|
177
|
+
.def("ReturnAtomicCoordinatesAssetPointer", &AtomicCoordinatesAssetList::ReturnAtomicCoordinatesAssetPointer)
|
|
178
|
+
.def("ReturnAssetID", &AtomicCoordinatesAssetList::ReturnAssetID)
|
|
179
|
+
.def("ReturnParentAssetID", &AtomicCoordinatesAssetList::ReturnParentAssetID)
|
|
180
|
+
.def("ReturnAssetName", &AtomicCoordinatesAssetList::ReturnAssetName)
|
|
181
|
+
.def("ReturnArrayPositionFromID", &AtomicCoordinatesAssetList::ReturnArrayPositionFromID)
|
|
182
|
+
.def("ReturnArrayPositionFromParentID", &AtomicCoordinatesAssetList::ReturnArrayPositionFromParentID)
|
|
183
|
+
.def("ReturnAssetFullFilename", &AtomicCoordinatesAssetList::ReturnAssetFullFilename)
|
|
184
|
+
.def("AddAsset", &AtomicCoordinatesAssetList::AddAsset)
|
|
185
|
+
.def("RemoveAsset", &AtomicCoordinatesAssetList::RemoveAsset)
|
|
186
|
+
.def("RemoveAll", &AtomicCoordinatesAssetList::RemoveAll)
|
|
187
|
+
.def("FindFile", &AtomicCoordinatesAssetList::FindFile)
|
|
188
|
+
.def("CheckMemory", &AtomicCoordinatesAssetList::CheckMemory);
|
|
189
|
+
|
|
190
|
+
// CTF
|
|
191
|
+
|
|
192
|
+
py::class_<CTF> ctf(m, "CTF");
|
|
193
|
+
ctf
|
|
194
|
+
.def(py::init([]( float wanted_acceleration_voltage_in_kV, // keV
|
|
195
|
+
float wanted_spherical_aberration_in_mm, // mm
|
|
196
|
+
float wanted_amplitude_contrast,
|
|
197
|
+
float wanted_defocus_1_in_angstroms, // A
|
|
198
|
+
float wanted_defocus_2_in_angstroms, //A
|
|
199
|
+
float wanted_astigmatism_azimuth_in_degrees, // degrees
|
|
200
|
+
float wanted_lowest_frequency_for_fitting_in_reciprocal_angstroms, // 1/A
|
|
201
|
+
float wanted_highest_frequency_for_fitting_in_reciprocal_angstroms, // 1/A
|
|
202
|
+
float wanted_astigmatism_tolerance_in_angstroms, // A. Set to negative to indicate no restraint on astigmatism.
|
|
203
|
+
float pixel_size_in_angstroms, // A
|
|
204
|
+
float wanted_additional_phase_shift_in_radians, //rad
|
|
205
|
+
float wanted_beam_tilt_x_in_radians, // rad
|
|
206
|
+
float wanted_beam_tilt_y_in_radians, // rad
|
|
207
|
+
float wanted_particle_shift_x_in_angstroms, // A
|
|
208
|
+
float wanted_particle_shift_y_in_angstroms) // A
|
|
209
|
+
{
|
|
210
|
+
CTF ctf = CTF();
|
|
211
|
+
if (wanted_highest_frequency_for_fitting_in_reciprocal_angstroms <= 0.0f) {
|
|
212
|
+
wanted_highest_frequency_for_fitting_in_reciprocal_angstroms = 1.0/(2.0*pixel_size_in_angstroms);
|
|
213
|
+
}
|
|
214
|
+
ctf.Init(wanted_acceleration_voltage_in_kV,
|
|
215
|
+
wanted_spherical_aberration_in_mm,
|
|
216
|
+
wanted_amplitude_contrast,
|
|
217
|
+
wanted_defocus_1_in_angstroms,
|
|
218
|
+
wanted_defocus_2_in_angstroms,
|
|
219
|
+
wanted_astigmatism_azimuth_in_degrees,
|
|
220
|
+
wanted_lowest_frequency_for_fitting_in_reciprocal_angstroms,
|
|
221
|
+
wanted_highest_frequency_for_fitting_in_reciprocal_angstroms,
|
|
222
|
+
wanted_astigmatism_tolerance_in_angstroms,
|
|
223
|
+
pixel_size_in_angstroms,
|
|
224
|
+
wanted_additional_phase_shift_in_radians,
|
|
225
|
+
wanted_beam_tilt_x_in_radians,
|
|
226
|
+
wanted_beam_tilt_y_in_radians,
|
|
227
|
+
wanted_particle_shift_x_in_angstroms,
|
|
228
|
+
wanted_particle_shift_y_in_angstroms);
|
|
229
|
+
return ctf;
|
|
230
|
+
}), py::arg("kV") = 300.0,
|
|
231
|
+
py::arg("cs") = 2.7,
|
|
232
|
+
py::arg("ac") = 0.07,
|
|
233
|
+
py::arg("defocus1") = 0.0,
|
|
234
|
+
py::arg("defocus2") = 0.0,
|
|
235
|
+
py::arg("astig_angle") = 0.0,
|
|
236
|
+
py::arg("low_freq") = 0.0,
|
|
237
|
+
py::arg("high_freq") = 0.0,
|
|
238
|
+
py::arg("astig_tol") = -10.0,
|
|
239
|
+
py::arg("pixel_size") = 1.0,
|
|
240
|
+
py::arg("phase_shift") = 0.0,
|
|
241
|
+
py::arg("beam_tilt_x") = 0.0,
|
|
242
|
+
py::arg("beam_tilt_y") = 0.0,
|
|
243
|
+
py::arg("particle_shift_x") = 0.0,
|
|
244
|
+
py::arg("particle_shift_y") = 0.0
|
|
245
|
+
)
|
|
246
|
+
//.def_readonly("thickness", &CTF::thickness)
|
|
247
|
+
//.def(py::init<float,float,float,float,float,float,float,float,float,float,float,float,float,float,float>())
|
|
248
|
+
//.def(py::init<float,float,float,float,float,float,float,float,float,float,float,float>())
|
|
249
|
+
//.def("Init", (void (CTF::*)(float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float))&CTF::Init)
|
|
250
|
+
//.def("Init", (void (CTF::*)(float,float,float,float,float,float,float,float,float))&CTF::Init)
|
|
251
|
+
.def("SetDefocus", &CTF::SetDefocus)
|
|
252
|
+
.def("SetAdditionalPhaseShift", &CTF::SetAdditionalPhaseShift)
|
|
253
|
+
.def("SetEnvelope", &CTF::SetEnvelope)
|
|
254
|
+
.def("SetBeamTilt", &CTF::SetBeamTilt)
|
|
255
|
+
.def("SetHighestFrequencyForFitting", &CTF::SetHighestFrequencyForFitting)
|
|
256
|
+
.def("SetLowResolutionContrast", &CTF::SetLowResolutionContrast)
|
|
257
|
+
.def("SetHighestFrequencyWithGoodFit", &CTF::SetHighestFrequencyWithGoodFit)
|
|
258
|
+
.def("EvaluateComplex", &CTF::EvaluateComplex)
|
|
259
|
+
.def("Evaluate", &CTF::Evaluate)
|
|
260
|
+
.def("SetSampleThickness", &CTF::SetSampleThickness)
|
|
261
|
+
.def("EvaluatePowerspectrumWithThickness", &CTF::EvaluatePowerspectrumWithThickness)
|
|
262
|
+
.def("IntegratedDefocusModulation", &CTF::IntegratedDefocusModulation)
|
|
263
|
+
.def("EvaluateWithEnvelope", &CTF::EvaluateWithEnvelope)
|
|
264
|
+
.def("PhaseShiftGivenSquaredSpatialFrequencyAndAzimuth", &CTF::PhaseShiftGivenSquaredSpatialFrequencyAndAzimuth)
|
|
265
|
+
.def("EvaluateBeamTiltPhaseShift", &CTF::EvaluateBeamTiltPhaseShift)
|
|
266
|
+
.def("PhaseShiftGivenBeamTiltAndShift", &CTF::PhaseShiftGivenBeamTiltAndShift)
|
|
267
|
+
.def("PhaseShiftGivenSquaredSpatialFrequencyAndDefocus", &CTF::PhaseShiftGivenSquaredSpatialFrequencyAndDefocus)
|
|
268
|
+
.def("DefocusGivenAzimuth", &CTF::DefocusGivenAzimuth)
|
|
269
|
+
.def("BeamTiltGivenAzimuth", &CTF::BeamTiltGivenAzimuth)
|
|
270
|
+
.def("ParticleShiftGivenAzimuth", &CTF::ParticleShiftGivenAzimuth)
|
|
271
|
+
//.def("WavelengthGivenAccelerationVoltage", &CTF::WavelengthGivenAccelerationVoltage)
|
|
272
|
+
.def("GetLowestFrequencyForFitting", &CTF::GetLowestFrequencyForFitting)
|
|
273
|
+
.def("GetHighestFrequencyForFitting", &CTF::GetHighestFrequencyForFitting)
|
|
274
|
+
.def("GetHighestFrequencyWithGoodFit", &CTF::GetHighestFrequencyWithGoodFit)
|
|
275
|
+
.def("GetAstigmatismTolerance", &CTF::GetAstigmatismTolerance)
|
|
276
|
+
.def("GetAstigmatism", &CTF::GetAstigmatism)
|
|
277
|
+
.def("IsAlmostEqualTo", &CTF::IsAlmostEqualTo)
|
|
278
|
+
.def("BeamTiltIsAlmostEqualTo", &CTF::BeamTiltIsAlmostEqualTo)
|
|
279
|
+
.def("EnforceConvention", &CTF::EnforceConvention)
|
|
280
|
+
//.def("PrintInfo", &CTF::PrintInfo)
|
|
281
|
+
.def("CopyFrom", &CTF::CopyFrom)
|
|
282
|
+
.def("ChangePixelSize", &CTF::ChangePixelSize)
|
|
283
|
+
.def("GetDefocus1", &CTF::GetDefocus1)
|
|
284
|
+
.def("GetDefocus2", &CTF::GetDefocus2)
|
|
285
|
+
.def("GetBeamTiltX", &CTF::GetBeamTiltX)
|
|
286
|
+
.def("GetBeamTiltY", &CTF::GetBeamTiltY)
|
|
287
|
+
.def("GetSphericalAberration", &CTF::GetSphericalAberration)
|
|
288
|
+
.def("GetAmplitudeContrast", &CTF::GetAmplitudeContrast)
|
|
289
|
+
.def("GetAstigmatismAzimuth", &CTF::GetAstigmatismAzimuth)
|
|
290
|
+
.def("GetAdditionalPhaseShift", &CTF::GetAdditionalPhaseShift)
|
|
291
|
+
.def("GetWavelength", &CTF::GetWavelength)
|
|
292
|
+
.def("ReturnNumberOfExtremaBeforeSquaredSpatialFrequency", &CTF::ReturnNumberOfExtremaBeforeSquaredSpatialFrequency)
|
|
293
|
+
.def("ReturnSquaredSpatialFrequencyGivenPhaseShiftAndAzimuth", &CTF::ReturnSquaredSpatialFrequencyGivenPhaseShiftAndAzimuth)
|
|
294
|
+
.def("ReturnSquaredSpatialFrequencyOfAZero", &CTF::ReturnSquaredSpatialFrequencyOfAZero)
|
|
295
|
+
.def("ReturnSquaredSpatialFrequencyOfPhaseShiftExtremumGivenAzimuth", &CTF::ReturnSquaredSpatialFrequencyOfPhaseShiftExtremumGivenAzimuth)
|
|
296
|
+
.def("ReturnSquaredSpatialFrequencyOfPhaseShiftExtremumGivenDefocus", &CTF::ReturnSquaredSpatialFrequencyOfPhaseShiftExtremumGivenDefocus)
|
|
297
|
+
.def("ReturnPhaseAberrationMaximum", &CTF::ReturnPhaseAberrationMaximum)
|
|
298
|
+
.def("ReturnPhaseAberrationMaximumGivenDefocus", &CTF::ReturnPhaseAberrationMaximumGivenDefocus);
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
// Curve
|
|
302
|
+
|
|
303
|
+
py::class_<Curve> curve(m, "Curve");
|
|
304
|
+
curve
|
|
305
|
+
.def(py::init<>())
|
|
306
|
+
.def(py::init<::Curve>())
|
|
307
|
+
/*.def("operator=", [](Curve &__inst) {
|
|
308
|
+
::Curve other_curve;
|
|
309
|
+
auto __ret = __inst.operator=(other_curve);
|
|
310
|
+
return std::make_tuple(__ret, other_curve);
|
|
311
|
+
})*/
|
|
312
|
+
.def_readonly("number_of_points", &Curve::number_of_points)
|
|
313
|
+
.def_property_readonly("data_x", [](Curve &__inst) {
|
|
314
|
+
//return 5;
|
|
315
|
+
py::capsule buffer_handle([](){});
|
|
316
|
+
return py::array_t<float>(
|
|
317
|
+
{__inst.number_of_points},
|
|
318
|
+
{4},
|
|
319
|
+
__inst.data_x,
|
|
320
|
+
buffer_handle
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
.def_property_readonly("data_y", [](Curve &__inst) {
|
|
325
|
+
//return 5;
|
|
326
|
+
py::capsule buffer_handle([](){});
|
|
327
|
+
return py::array_t<float>(
|
|
328
|
+
{__inst.number_of_points},
|
|
329
|
+
{4},
|
|
330
|
+
__inst.data_y,
|
|
331
|
+
buffer_handle
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
//.def("operator=", (Curve (Curve::*)(::Curve))&Curve::operator=)
|
|
336
|
+
.def("ResampleCurve", &Curve::ResampleCurve)
|
|
337
|
+
.def("ReturnLinearInterpolationFromI", &Curve::ReturnLinearInterpolationFromI)
|
|
338
|
+
.def("ReturnLinearInterpolationFromX", &Curve::ReturnLinearInterpolationFromX)
|
|
339
|
+
.def("ReturnValueAtXUsingLinearInterpolation", &Curve::ReturnValueAtXUsingLinearInterpolation)
|
|
340
|
+
.def("AddValueAtXUsingLinearInterpolation", &Curve::AddValueAtXUsingLinearInterpolation)
|
|
341
|
+
.def("AddValueAtXUsingNearestNeighborInterpolation", &Curve::AddValueAtXUsingNearestNeighborInterpolation)
|
|
342
|
+
.def("ReturnIndexOfNearestPreviousBin", &Curve::ReturnIndexOfNearestPreviousBin)
|
|
343
|
+
.def("PrintToStandardOut", &Curve::PrintToStandardOut)
|
|
344
|
+
.def("WriteToFile", (void (Curve::*)(wxString))&Curve::WriteToFile)
|
|
345
|
+
.def("WriteToFile", (void (Curve::*)(wxString,wxString))&Curve::WriteToFile)
|
|
346
|
+
.def("CopyFrom", &Curve::CopyFrom)
|
|
347
|
+
.def("CopyDataFromArrays", &Curve::CopyDataFromArrays)
|
|
348
|
+
.def("CopyYValuesFromArray", &Curve::CopyYValuesFromArray)
|
|
349
|
+
.def("ClearData", &Curve::ClearData)
|
|
350
|
+
.def("MultiplyByConstant", &Curve::MultiplyByConstant)
|
|
351
|
+
.def("MultiplyXByConstant", &Curve::MultiplyXByConstant)
|
|
352
|
+
.def("AddPoint", &Curve::AddPoint)
|
|
353
|
+
.def("FitPolynomialToData", &Curve::FitPolynomialToData)
|
|
354
|
+
.def("FitGaussianToData", &Curve::FitGaussianToData)
|
|
355
|
+
.def("FitSavitzkyGolayToData", &Curve::FitSavitzkyGolayToData)
|
|
356
|
+
.def("ReturnSavitzkyGolayInterpolationFromX", &Curve::ReturnSavitzkyGolayInterpolationFromX)
|
|
357
|
+
.def("ReturnIndexOfNearestPointFromX", &Curve::ReturnIndexOfNearestPointFromX)
|
|
358
|
+
.def("DeleteSavitzkyGolayCoefficients", &Curve::DeleteSavitzkyGolayCoefficients)
|
|
359
|
+
.def("AllocateSavitzkyGolayCoefficients", &Curve::AllocateSavitzkyGolayCoefficients)
|
|
360
|
+
.def("CheckMemory", &Curve::CheckMemory)
|
|
361
|
+
.def("AllocateMemory", &Curve::AllocateMemory)
|
|
362
|
+
.def("AddWith", &Curve::AddWith)
|
|
363
|
+
/*.def("DivideBy", (void (Curve::*)(::Curve))&Curve::DivideBy)
|
|
364
|
+
.def("DivideBy", [](Curve &__inst) {
|
|
365
|
+
::Curve other_curve;
|
|
366
|
+
__inst.DivideBy(other_curve);
|
|
367
|
+
return other_curve;
|
|
368
|
+
})*/
|
|
369
|
+
.def("SetupXAxis", &Curve::SetupXAxis)
|
|
370
|
+
.def("ReturnMaximumValue", &Curve::ReturnMaximumValue)
|
|
371
|
+
.def("ReturnMode", &Curve::ReturnMode)
|
|
372
|
+
.def("ComputeMaximumValueAndMode", [](Curve &__inst) {
|
|
373
|
+
float maximum_value; float mode;
|
|
374
|
+
__inst.ComputeMaximumValueAndMode(maximum_value, mode);
|
|
375
|
+
return std::make_tuple(maximum_value, mode);
|
|
376
|
+
})
|
|
377
|
+
.def("ReturnFullWidthAtGivenValue", [](Curve &__inst) {
|
|
378
|
+
float wanted_value;
|
|
379
|
+
auto __ret = __inst.ReturnFullWidthAtGivenValue(wanted_value);
|
|
380
|
+
return std::make_tuple(__ret, wanted_value);
|
|
381
|
+
})
|
|
382
|
+
.def("NormalizeMaximumValue", &Curve::NormalizeMaximumValue)
|
|
383
|
+
.def("Logarithm", &Curve::Logarithm)
|
|
384
|
+
.def("ZeroYData", &Curve::ZeroYData)
|
|
385
|
+
.def("ApplyCTF", &Curve::ApplyCTF)
|
|
386
|
+
.def("SquareRoot", &Curve::SquareRoot)
|
|
387
|
+
.def("Reciprocal", &Curve::Reciprocal)
|
|
388
|
+
.def("MultiplyBy", [](Curve &__inst) {
|
|
389
|
+
::Curve other_curve;
|
|
390
|
+
__inst.MultiplyBy(other_curve);
|
|
391
|
+
return other_curve;
|
|
392
|
+
})
|
|
393
|
+
.def("ZeroAfterIndex", &Curve::ZeroAfterIndex)
|
|
394
|
+
.def("FlattenBeforeIndex", &Curve::FlattenBeforeIndex)
|
|
395
|
+
.def("ReturnAverageValue", &Curve::ReturnAverageValue)
|
|
396
|
+
.def("ApplyCosineMask", &Curve::ApplyCosineMask)
|
|
397
|
+
.def("ApplyGaussianLowPassFilter", &Curve::ApplyGaussianLowPassFilter)
|
|
398
|
+
.def("GetXMinMax", [](Curve &__inst) {
|
|
399
|
+
float min_value; float max_value;
|
|
400
|
+
__inst.GetXMinMax(min_value, max_value);
|
|
401
|
+
return std::make_tuple(min_value, max_value);
|
|
402
|
+
})
|
|
403
|
+
.def("GetYMinMax", [](Curve &__inst) {
|
|
404
|
+
float min_value; float max_value;
|
|
405
|
+
__inst.GetYMinMax(min_value, max_value);
|
|
406
|
+
return std::make_tuple(min_value, max_value);
|
|
407
|
+
})
|
|
408
|
+
.def("SetYToConstant", &Curve::SetYToConstant);
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
// Database
|
|
412
|
+
init_database(m);
|
|
413
|
+
//Run Profiles
|
|
414
|
+
init_run_profiles(m);
|
|
415
|
+
// Euler Search
|
|
416
|
+
init_euler(m);
|
|
417
|
+
// ElectronDose
|
|
418
|
+
py::class_<ElectronDose> electrondose(m, "ElectronDose");
|
|
419
|
+
electrondose
|
|
420
|
+
.def(py::init<>())
|
|
421
|
+
.def(py::init<float,float>())
|
|
422
|
+
.def("Init", &ElectronDose::Init)
|
|
423
|
+
.def("ReturnCriticalDose", &ElectronDose::ReturnCriticalDose)
|
|
424
|
+
.def("ReturnDoseFilter", &ElectronDose::ReturnDoseFilter)
|
|
425
|
+
.def("ReturnCummulativeDoseFilter", &ElectronDose::ReturnCummulativeDoseFilter)
|
|
426
|
+
.def("CalculateCummulativeDoseFilterAs1DArray", [](ElectronDose &__inst, Image &ref_image, float dose_start, float dose_end)
|
|
427
|
+
{
|
|
428
|
+
float dose_filter[ref_image.real_memory_allocated / 2];
|
|
429
|
+
|
|
430
|
+
ZeroFloatArray(dose_filter, ref_image.real_memory_allocated / 2);
|
|
431
|
+
__inst.CalculateCummulativeDoseFilterAs1DArray(&ref_image, dose_filter, dose_start, dose_end);
|
|
432
|
+
py::capsule buffer_handle([](){});
|
|
433
|
+
return py::array_t<float>(
|
|
434
|
+
{ref_image.real_memory_allocated / 2},
|
|
435
|
+
{4},
|
|
436
|
+
dose_filter,
|
|
437
|
+
buffer_handle
|
|
438
|
+
);
|
|
439
|
+
})
|
|
440
|
+
.def("CalculateDoseFilterAs1DArray", [](ElectronDose &__inst, Image &ref_image, float dose_start, float dose_end)
|
|
441
|
+
{
|
|
442
|
+
float dose_filter[ref_image.real_memory_allocated / 2];
|
|
443
|
+
|
|
444
|
+
ZeroFloatArray(dose_filter, ref_image.real_memory_allocated / 2);
|
|
445
|
+
__inst.CalculateCummulativeDoseFilterAs1DArray(&ref_image, dose_filter, dose_start, dose_end);
|
|
446
|
+
py::capsule buffer_handle([](){});
|
|
447
|
+
return py::array_t<float>(
|
|
448
|
+
{ref_image.real_memory_allocated / 2},
|
|
449
|
+
{4},
|
|
450
|
+
dose_filter,
|
|
451
|
+
buffer_handle
|
|
452
|
+
);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
// Project
|
|
456
|
+
|
|
457
|
+
py::class_<Project> project(m, "Project");
|
|
458
|
+
project
|
|
459
|
+
.def(py::init<>())
|
|
460
|
+
.def_readonly("database", &Project::database)
|
|
461
|
+
.def("Close", &Project::Close)
|
|
462
|
+
.def("CreateNewProject", [](Project &__inst, std::string database_file, std::string project_directory, std::string project_name)
|
|
463
|
+
{
|
|
464
|
+
wxString wanted_database_file = database_file;
|
|
465
|
+
return __inst.CreateNewProject(wanted_database_file, project_directory, project_name);
|
|
466
|
+
})
|
|
467
|
+
.def("OpenProjectFromFile", [](Project &__inst, std::string database_file)
|
|
468
|
+
{
|
|
469
|
+
wxString wanted_database_file = database_file;
|
|
470
|
+
return __inst.OpenProjectFromFile(wanted_database_file);
|
|
471
|
+
})
|
|
472
|
+
.def("ReadMasterSettings", &Project::ReadMasterSettings)
|
|
473
|
+
.def("WriteProjectStatisticsToDatabase", &Project::WriteProjectStatisticsToDatabase);
|
|
474
|
+
|
|
475
|
+
// Image
|
|
476
|
+
|
|
477
|
+
py::class_<Image> image(m, "Image");
|
|
478
|
+
image
|
|
479
|
+
.def(py::init<>())
|
|
480
|
+
.def(py::init<::Image>())
|
|
481
|
+
.def_readonly("logical_x_dimension", &Image::logical_x_dimension)
|
|
482
|
+
.def_readonly("logical_y_dimension", &Image::logical_y_dimension)
|
|
483
|
+
.def_readonly("logical_z_dimension", &Image::logical_z_dimension)
|
|
484
|
+
.def_readonly("physical_upper_bound_complex_x", &Image::physical_upper_bound_complex_x)
|
|
485
|
+
.def_readonly("physical_upper_bound_complex_y", &Image::physical_upper_bound_complex_y)
|
|
486
|
+
.def_readonly("physical_upper_bound_complex_z", &Image::physical_upper_bound_complex_z)
|
|
487
|
+
.def_readonly("is_in_real_space", &Image::is_in_real_space)
|
|
488
|
+
.def_property_readonly("real_values", [](Image &__inst) {
|
|
489
|
+
//return 5;
|
|
490
|
+
py::capsule buffer_handle([](){});
|
|
491
|
+
if (__inst.logical_z_dimension == 1) {
|
|
492
|
+
return py::array_t<float>(
|
|
493
|
+
{__inst.logical_y_dimension, __inst.logical_x_dimension},
|
|
494
|
+
{sizeof(float) * (__inst.logical_x_dimension + __inst.padding_jump_value), /* Strides (in bytes) for each index */
|
|
495
|
+
sizeof(float)},
|
|
496
|
+
__inst.real_values,
|
|
497
|
+
buffer_handle
|
|
498
|
+
);
|
|
499
|
+
} else {
|
|
500
|
+
return py::array_t<float>(
|
|
501
|
+
{__inst.logical_z_dimension, __inst.logical_y_dimension, __inst.logical_x_dimension},
|
|
502
|
+
{sizeof(float) * (__inst.logical_x_dimension + __inst.padding_jump_value) * (__inst.logical_y_dimension) ,sizeof(float) * (__inst.logical_x_dimension + __inst.padding_jump_value), sizeof(float)
|
|
503
|
+
},
|
|
504
|
+
__inst.real_values,
|
|
505
|
+
buffer_handle
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
.def_property_readonly("complex_values", [](Image &__inst) {
|
|
511
|
+
//return 5;
|
|
512
|
+
py::capsule buffer_handle([](){});
|
|
513
|
+
return py::array_t<std::complex<float>>(
|
|
514
|
+
{__inst.physical_upper_bound_complex_y, __inst.physical_upper_bound_complex_x},
|
|
515
|
+
{sizeof(std::complex<float>) * __inst.physical_upper_bound_complex_x , /* Strides (in bytes) for each index */
|
|
516
|
+
sizeof(std::complex<float>)},
|
|
517
|
+
__inst.complex_values,
|
|
518
|
+
buffer_handle
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
/* .def("operator=", [](Image &__inst) {
|
|
523
|
+
::Image t;
|
|
524
|
+
auto __ret = __inst.operator=(t);
|
|
525
|
+
return std::make_tuple(__ret, t);
|
|
526
|
+
})
|
|
527
|
+
.def("operator=", (Image (Image::*)(::Image))&Image::operator=) */
|
|
528
|
+
.def("SetupInitialValues", &Image::SetupInitialValues)
|
|
529
|
+
.def("Allocate", (void (Image::*)(int, int, int, bool, bool)) & Image::Allocate)
|
|
530
|
+
.def("Allocate", (void (Image::*)(int, int, bool)) & Image::Allocate)
|
|
531
|
+
//.def("Allocate", (void (Image::*)(::Image))&Image::Allocate)
|
|
532
|
+
.def("AllocateAsPointingToSliceIn3D", &Image::AllocateAsPointingToSliceIn3D)
|
|
533
|
+
.def("Deallocate", &Image::Deallocate)
|
|
534
|
+
.def("ReturnSmallestLogicalDimension", &Image::ReturnSmallestLogicalDimension)
|
|
535
|
+
.def("ReturnLargestLogicalDimension", &Image::ReturnLargestLogicalDimension)
|
|
536
|
+
.def("SampleFFT", [](Image &__inst, int sample_rate)
|
|
537
|
+
{
|
|
538
|
+
::Image sampled_image;
|
|
539
|
+
__inst.SampleFFT(sampled_image, sample_rate);
|
|
540
|
+
return sampled_image;
|
|
541
|
+
})
|
|
542
|
+
.def("ReturnSumOfSquares", &Image::ReturnSumOfSquares)
|
|
543
|
+
.def("ReturnSumOfRealValues", &Image::ReturnSumOfRealValues)
|
|
544
|
+
.def("ReturnSigmaNoise", (float (Image::*)()) & Image::ReturnSigmaNoise)
|
|
545
|
+
.def("ReturnSigmaNoise", [](Image &__inst, float mask_radius)
|
|
546
|
+
{
|
|
547
|
+
::Image matching_projection;
|
|
548
|
+
auto __ret = __inst.ReturnSigmaNoise(matching_projection, mask_radius);
|
|
549
|
+
return std::make_tuple(__ret, matching_projection);
|
|
550
|
+
})
|
|
551
|
+
.def("ReturnImageScale", [](Image &__inst, float mask_radius)
|
|
552
|
+
{
|
|
553
|
+
::Image matching_projection;
|
|
554
|
+
auto __ret = __inst.ReturnImageScale(matching_projection, mask_radius);
|
|
555
|
+
return std::make_tuple(__ret, matching_projection);
|
|
556
|
+
})
|
|
557
|
+
.def("ReturnCorrelationCoefficientUnnormalized", [](Image &__inst, float wanted_mask_radius)
|
|
558
|
+
{
|
|
559
|
+
::Image other_image;
|
|
560
|
+
auto __ret = __inst.ReturnCorrelationCoefficientUnnormalized(other_image, wanted_mask_radius);
|
|
561
|
+
return std::make_tuple(__ret, other_image);
|
|
562
|
+
})
|
|
563
|
+
.def("ReturnBeamTiltSignificanceScore", &Image::ReturnBeamTiltSignificanceScore)
|
|
564
|
+
.def("ReturnPixelWiseProduct", [](Image &__inst)
|
|
565
|
+
{
|
|
566
|
+
::Image other_image;
|
|
567
|
+
auto __ret = __inst.ReturnPixelWiseProduct(other_image);
|
|
568
|
+
return std::make_tuple(__ret, other_image);
|
|
569
|
+
})
|
|
570
|
+
.def("GetWeightedCorrelationWithImage", [](Image &__inst, int *bins, float signed_CC_limit)
|
|
571
|
+
{
|
|
572
|
+
::Image projection_image;
|
|
573
|
+
auto __ret = __inst.GetWeightedCorrelationWithImage(projection_image, bins, signed_CC_limit);
|
|
574
|
+
return std::make_tuple(__ret, projection_image);
|
|
575
|
+
})
|
|
576
|
+
.def("PhaseFlipPixelWise", [](Image &__inst)
|
|
577
|
+
{
|
|
578
|
+
::Image other_image;
|
|
579
|
+
__inst.PhaseFlipPixelWise(other_image);
|
|
580
|
+
return other_image;
|
|
581
|
+
})
|
|
582
|
+
.def("MultiplyPixelWiseReal", [](Image &__inst, bool absolute)
|
|
583
|
+
{
|
|
584
|
+
::Image other_image;
|
|
585
|
+
__inst.MultiplyPixelWiseReal(other_image, absolute);
|
|
586
|
+
return other_image;
|
|
587
|
+
})
|
|
588
|
+
.def("MultiplyPixelWise", [](Image &__inst)
|
|
589
|
+
{
|
|
590
|
+
::Image other_image;
|
|
591
|
+
__inst.MultiplyPixelWise(other_image);
|
|
592
|
+
return other_image;
|
|
593
|
+
})
|
|
594
|
+
.def("ConjugateMultiplyPixelWise", [](Image &__inst)
|
|
595
|
+
{
|
|
596
|
+
::Image other_image;
|
|
597
|
+
__inst.ConjugateMultiplyPixelWise(other_image);
|
|
598
|
+
return other_image;
|
|
599
|
+
})
|
|
600
|
+
.def("ComputeFSCVectorized", &Image::ComputeFSCVectorized)
|
|
601
|
+
.def("ComputeFSC", &Image::ComputeFSC)
|
|
602
|
+
.def("DividePixelWise", [](Image &__inst)
|
|
603
|
+
{
|
|
604
|
+
::Image other_image;
|
|
605
|
+
__inst.DividePixelWise(other_image);
|
|
606
|
+
return other_image;
|
|
607
|
+
})
|
|
608
|
+
.def("AddGaussianNoise", &Image::AddGaussianNoise)
|
|
609
|
+
.def("ZeroFloat", &Image::ZeroFloat)
|
|
610
|
+
.def("ZeroFloatAndNormalize", &Image::ZeroFloatAndNormalize)
|
|
611
|
+
.def("Normalize", &Image::Normalize)
|
|
612
|
+
//.def("NormalizeSumOfSquares", &Image::NormalizeSumOfSquares)
|
|
613
|
+
.def("ZeroFloatOutside", &Image::ZeroFloatOutside)
|
|
614
|
+
.def("ReplaceOutliersWithMean", static_cast<void (Image::*)(float)>(&Image::ReplaceOutliersWithMean))
|
|
615
|
+
.def("ReturnVarianceOfRealValues", &Image::ReturnVarianceOfRealValues)
|
|
616
|
+
.def("ReturnDistributionOfRealValues", &Image::ReturnDistributionOfRealValues)
|
|
617
|
+
.def("UpdateDistributionOfRealValues", &Image::UpdateDistributionOfRealValues)
|
|
618
|
+
.def("ApplySqrtNFilter", &Image::ApplySqrtNFilter)
|
|
619
|
+
.def("Whiten", &Image::Whiten)
|
|
620
|
+
.def("OptimalFilterBySNRImage", [](Image &__inst, int include_reference_weighting)
|
|
621
|
+
{
|
|
622
|
+
::Image SNR_image;
|
|
623
|
+
__inst.OptimalFilterBySNRImage(SNR_image, include_reference_weighting);
|
|
624
|
+
return SNR_image;
|
|
625
|
+
})
|
|
626
|
+
.def("MultiplyByWeightsCurve", [](Image &__inst, float scale_factor)
|
|
627
|
+
{
|
|
628
|
+
Curve weights;
|
|
629
|
+
__inst.MultiplyByWeightsCurve(weights, scale_factor);
|
|
630
|
+
return weights;
|
|
631
|
+
})
|
|
632
|
+
.def("WeightBySSNR", [](Image &__inst, float molecular_mass_kDa, float pixel_size, bool weight_particle_image, bool weight_projection_image)
|
|
633
|
+
{
|
|
634
|
+
::Image ctf_image;
|
|
635
|
+
Curve SSNR;
|
|
636
|
+
::Image projection_image;
|
|
637
|
+
__inst.WeightBySSNR(ctf_image, molecular_mass_kDa, pixel_size, SSNR, projection_image, weight_particle_image, weight_projection_image);
|
|
638
|
+
return std::make_tuple(ctf_image, SSNR, projection_image);
|
|
639
|
+
})
|
|
640
|
+
.def("OptimalFilterSSNR", [](Image &__inst)
|
|
641
|
+
{
|
|
642
|
+
Curve SSNR;
|
|
643
|
+
__inst.OptimalFilterSSNR(SSNR);
|
|
644
|
+
return SSNR;
|
|
645
|
+
})
|
|
646
|
+
.def("OptimalFilterFSC", [](Image &__inst)
|
|
647
|
+
{
|
|
648
|
+
Curve FSC;
|
|
649
|
+
__inst.OptimalFilterFSC(FSC);
|
|
650
|
+
return FSC;
|
|
651
|
+
})
|
|
652
|
+
.def("OptimalFilterWarp", &Image::OptimalFilterWarp)
|
|
653
|
+
.def("CorrectSinc", &Image::CorrectSinc)
|
|
654
|
+
.def("MirrorXFourier2D", [](Image &__inst)
|
|
655
|
+
{
|
|
656
|
+
::Image mirrored_image;
|
|
657
|
+
__inst.MirrorXFourier2D(mirrored_image);
|
|
658
|
+
return mirrored_image;
|
|
659
|
+
})
|
|
660
|
+
.def("MirrorYFourier2D", [](Image &__inst)
|
|
661
|
+
{
|
|
662
|
+
::Image mirrored_image;
|
|
663
|
+
__inst.MirrorYFourier2D(mirrored_image);
|
|
664
|
+
return mirrored_image;
|
|
665
|
+
})
|
|
666
|
+
.def("RotateQuadrants", [](Image &__inst, int quad_i)
|
|
667
|
+
{
|
|
668
|
+
::Image rotated_image;
|
|
669
|
+
__inst.RotateQuadrants(rotated_image, quad_i);
|
|
670
|
+
return rotated_image;
|
|
671
|
+
})
|
|
672
|
+
.def("Rotate3DByRotationMatrixAndOrApplySymmetry", [](Image &__inst, float wanted_max_radius_in_pixels, wxString wanted_symmetry)
|
|
673
|
+
{
|
|
674
|
+
RotationMatrix wanted_matrix;
|
|
675
|
+
__inst.Rotate3DByRotationMatrixAndOrApplySymmetry(wanted_matrix, wanted_max_radius_in_pixels, wanted_symmetry);
|
|
676
|
+
return wanted_matrix;
|
|
677
|
+
})
|
|
678
|
+
.def("Rotate3DByRotationMatrixAndOrApplySymmetryThenShift", [](Image &__inst, float wanted_x_shift, float wanted_y_shift, float wanted_z_shift, float wanted_max_radius_in_pixels, wxString wanted_symmetry)
|
|
679
|
+
{
|
|
680
|
+
RotationMatrix wanted_matrix;
|
|
681
|
+
__inst.Rotate3DByRotationMatrixAndOrApplySymmetryThenShift(wanted_matrix, wanted_x_shift, wanted_y_shift, wanted_z_shift, wanted_max_radius_in_pixels, wanted_symmetry);
|
|
682
|
+
return wanted_matrix;
|
|
683
|
+
})
|
|
684
|
+
.def("Rotate3DThenShiftThenApplySymmetry", [](Image &__inst, float wanted_x_shift, float wanted_y_shift, float wanted_z_shift, float wanted_max_radius_in_pixels, wxString wanted_symmetry)
|
|
685
|
+
{
|
|
686
|
+
RotationMatrix wanted_matrix;
|
|
687
|
+
__inst.Rotate3DThenShiftThenApplySymmetry(wanted_matrix, wanted_x_shift, wanted_y_shift, wanted_z_shift, wanted_max_radius_in_pixels, wanted_symmetry);
|
|
688
|
+
return wanted_matrix;
|
|
689
|
+
})
|
|
690
|
+
.def("GenerateReferenceProjections", [](Image &__inst, Image *projections, float resolution)
|
|
691
|
+
{
|
|
692
|
+
EulerSearch parameters;
|
|
693
|
+
__inst.GenerateReferenceProjections(projections, parameters, resolution);
|
|
694
|
+
return parameters;
|
|
695
|
+
})
|
|
696
|
+
/* .def("RotateFourier2DGenerateIndex", [](Image &__inst, float psi_max, float psi_step, float psi_start, bool invert_angle) {
|
|
697
|
+
Kernel2D kernel_index;
|
|
698
|
+
__inst.RotateFourier2DGenerateIndex(kernel_index, psi_max, psi_step, psi_start, invert_angle);
|
|
699
|
+
return kernel_index;
|
|
700
|
+
})
|
|
701
|
+
.def("RotateFourier2DDeleteIndex", [](Image &__inst, float psi_max, float psi_step) {
|
|
702
|
+
Kernel2D kernel_index;
|
|
703
|
+
__inst.RotateFourier2DDeleteIndex(kernel_index, psi_max, psi_step);
|
|
704
|
+
return kernel_index;
|
|
705
|
+
}) */
|
|
706
|
+
.def("RotateFourier2DFromIndex", [](Image &__inst, Kernel2D *kernel_index)
|
|
707
|
+
{
|
|
708
|
+
::Image rotated_image;
|
|
709
|
+
__inst.RotateFourier2DFromIndex(rotated_image, kernel_index);
|
|
710
|
+
return rotated_image;
|
|
711
|
+
})
|
|
712
|
+
.def("RotateFourier2DIndex", [](Image &__inst, Kernel2D *kernel_index, float resolution_limit, float padding_factor)
|
|
713
|
+
{
|
|
714
|
+
AnglesAndShifts rotation_angle;
|
|
715
|
+
__inst.RotateFourier2DIndex(kernel_index, rotation_angle, resolution_limit, padding_factor);
|
|
716
|
+
return rotation_angle;
|
|
717
|
+
})
|
|
718
|
+
.def("ReturnLinearInterpolatedFourierKernel2D", [](Image &__inst)
|
|
719
|
+
{
|
|
720
|
+
float x;
|
|
721
|
+
float y;
|
|
722
|
+
auto __ret = __inst.ReturnLinearInterpolatedFourierKernel2D(x, y);
|
|
723
|
+
return std::make_tuple(__ret, x, y);
|
|
724
|
+
})
|
|
725
|
+
.def("RotateFourier2D", [](Image &__inst, float resolution_limit_in_reciprocal_pixels, bool use_nearest_neighbor)
|
|
726
|
+
{
|
|
727
|
+
::Image rotated_image;
|
|
728
|
+
AnglesAndShifts rotation_angle;
|
|
729
|
+
__inst.RotateFourier2D(rotated_image, rotation_angle, resolution_limit_in_reciprocal_pixels, use_nearest_neighbor);
|
|
730
|
+
return std::make_tuple(rotated_image, rotation_angle);
|
|
731
|
+
})
|
|
732
|
+
.def("Rotate2D", [](Image &__inst, float mask_radius_in_pixels)
|
|
733
|
+
{
|
|
734
|
+
::Image rotated_image;
|
|
735
|
+
AnglesAndShifts rotation_angle;
|
|
736
|
+
__inst.Rotate2D(rotated_image, rotation_angle, mask_radius_in_pixels);
|
|
737
|
+
return std::make_tuple(rotated_image, rotation_angle);
|
|
738
|
+
})
|
|
739
|
+
.def("Rotate2DInPlace", &Image::Rotate2DInPlace)
|
|
740
|
+
.def("Rotate2DSample", [](Image &__inst, float mask_radius_in_pixels)
|
|
741
|
+
{
|
|
742
|
+
::Image rotated_image;
|
|
743
|
+
AnglesAndShifts rotation_angle;
|
|
744
|
+
__inst.Rotate2DSample(rotated_image, rotation_angle, mask_radius_in_pixels);
|
|
745
|
+
return std::make_tuple(rotated_image, rotation_angle);
|
|
746
|
+
})
|
|
747
|
+
.def("Skew2D", [](Image &__inst, float height_offset, float minimum_height, float skew_axis, float skew_angle, bool adjust_signal)
|
|
748
|
+
{
|
|
749
|
+
::Image skewed_image;
|
|
750
|
+
auto __ret = __inst.Skew2D(skewed_image, height_offset, minimum_height, skew_axis, skew_angle, adjust_signal);
|
|
751
|
+
return std::make_tuple(__ret, skewed_image);
|
|
752
|
+
})
|
|
753
|
+
.def("ReturnLinearInterpolated2D", [](Image &__inst)
|
|
754
|
+
{
|
|
755
|
+
float wanted_physical_x_coordinate;
|
|
756
|
+
float wanted_physical_y_coordinate;
|
|
757
|
+
auto __ret = __inst.ReturnLinearInterpolated2D(wanted_physical_x_coordinate, wanted_physical_y_coordinate);
|
|
758
|
+
return std::make_tuple(__ret, wanted_physical_x_coordinate, wanted_physical_y_coordinate);
|
|
759
|
+
})
|
|
760
|
+
.def("ReturnNearest2D", [](Image &__inst)
|
|
761
|
+
{
|
|
762
|
+
float wanted_physical_x_coordinate;
|
|
763
|
+
float wanted_physical_y_coordinate;
|
|
764
|
+
auto __ret = __inst.ReturnNearest2D(wanted_physical_x_coordinate, wanted_physical_y_coordinate);
|
|
765
|
+
return std::make_tuple(__ret, wanted_physical_x_coordinate, wanted_physical_y_coordinate);
|
|
766
|
+
})
|
|
767
|
+
.def("ExtractSlice", [](Image &__inst, Image &image_to_extract, AnglesAndShifts &angles_and_shifts_of_image, float resolution_limit, bool apply_resolution_limit)
|
|
768
|
+
{
|
|
769
|
+
__inst.ExtractSlice(image_to_extract, angles_and_shifts_of_image, resolution_limit, apply_resolution_limit);
|
|
770
|
+
})
|
|
771
|
+
.def("ExtractSliceByRotMatrix", [](Image &__inst, float resolution_limit, bool apply_resolution_limit)
|
|
772
|
+
{
|
|
773
|
+
::Image image_to_extract;
|
|
774
|
+
RotationMatrix wanted_matrix;
|
|
775
|
+
__inst.ExtractSliceByRotMatrix(image_to_extract, wanted_matrix, resolution_limit, apply_resolution_limit);
|
|
776
|
+
return std::make_tuple(image_to_extract, wanted_matrix);
|
|
777
|
+
})
|
|
778
|
+
.def("ReturnNearestFourier2D", [](Image &__inst)
|
|
779
|
+
{
|
|
780
|
+
float x;
|
|
781
|
+
float y;
|
|
782
|
+
auto __ret = __inst.ReturnNearestFourier2D(x, y);
|
|
783
|
+
return std::make_tuple(__ret, x, y);
|
|
784
|
+
})
|
|
785
|
+
.def("ReturnLinearInterpolatedFourier2D", [](Image &__inst)
|
|
786
|
+
{
|
|
787
|
+
float x;
|
|
788
|
+
float y;
|
|
789
|
+
auto __ret = __inst.ReturnLinearInterpolatedFourier2D(x, y);
|
|
790
|
+
return std::make_tuple(__ret, x, y);
|
|
791
|
+
})
|
|
792
|
+
.def("ReturnLinearInterpolatedFourier", [](Image &__inst)
|
|
793
|
+
{
|
|
794
|
+
float x;
|
|
795
|
+
float y;
|
|
796
|
+
float z;
|
|
797
|
+
auto __ret = __inst.ReturnLinearInterpolatedFourier(x, y, z);
|
|
798
|
+
return std::make_tuple(__ret, x, y, z);
|
|
799
|
+
})
|
|
800
|
+
.def("AddByLinearInterpolationReal", [](Image &__inst)
|
|
801
|
+
{
|
|
802
|
+
float wanted_x_coordinate;
|
|
803
|
+
float wanted_y_coordinate;
|
|
804
|
+
float wanted_z_coordinate;
|
|
805
|
+
float wanted_value;
|
|
806
|
+
__inst.AddByLinearInterpolationReal(wanted_x_coordinate, wanted_y_coordinate, wanted_z_coordinate, wanted_value);
|
|
807
|
+
return std::make_tuple(wanted_x_coordinate, wanted_y_coordinate, wanted_z_coordinate, wanted_value);
|
|
808
|
+
})
|
|
809
|
+
.def("AddByLinearInterpolationFourier2D", [](Image &__inst)
|
|
810
|
+
{
|
|
811
|
+
float wanted_x_coordinate;
|
|
812
|
+
float wanted_y_coordinate;
|
|
813
|
+
std::complex<float> wanted_value;
|
|
814
|
+
__inst.AddByLinearInterpolationFourier2D(wanted_x_coordinate, wanted_y_coordinate, wanted_value);
|
|
815
|
+
return std::make_tuple(wanted_x_coordinate, wanted_y_coordinate, wanted_value);
|
|
816
|
+
})
|
|
817
|
+
.def("CosineRingMask", &Image::CosineRingMask)
|
|
818
|
+
.def("CosineMask", &Image::CosineMask)
|
|
819
|
+
.def("CosineRectangularMask", &Image::CosineRectangularMask)
|
|
820
|
+
.def("ConvertToAutoMask", &Image::ConvertToAutoMask)
|
|
821
|
+
.def("LocalResSignificanceFilter", &Image::LocalResSignificanceFilter)
|
|
822
|
+
.def("GaussianLowPassFilter", &Image::GaussianLowPassFilter)
|
|
823
|
+
.def("GaussianHighPassFilter", &Image::GaussianHighPassFilter)
|
|
824
|
+
.def("ApplyLocalResolutionFilter", [](Image &__inst, float pixel_size, int wanted_number_of_levels)
|
|
825
|
+
{
|
|
826
|
+
::Image local_resolution_map;
|
|
827
|
+
__inst.ApplyLocalResolutionFilter(local_resolution_map, pixel_size, wanted_number_of_levels);
|
|
828
|
+
return local_resolution_map;
|
|
829
|
+
})
|
|
830
|
+
.def("CircleMask", &Image::CircleMask)
|
|
831
|
+
.def("CircleMaskWithValue", &Image::CircleMaskWithValue)
|
|
832
|
+
.def("SquareMaskWithValue", &Image::SquareMaskWithValue)
|
|
833
|
+
.def("TriangleMask", &Image::TriangleMask)
|
|
834
|
+
.def("CalculateCTFImage", [](Image &__inst, bool calculate_complex_ctf, bool apply_coherence_envelope)
|
|
835
|
+
{
|
|
836
|
+
CTF ctf_of_image;
|
|
837
|
+
__inst.CalculateCTFImage(ctf_of_image, calculate_complex_ctf, apply_coherence_envelope);
|
|
838
|
+
return ctf_of_image;
|
|
839
|
+
})
|
|
840
|
+
.def("CalculateBeamTiltImage", [](Image &__inst, bool output_phase_shifts)
|
|
841
|
+
{
|
|
842
|
+
CTF ctf_of_image;
|
|
843
|
+
__inst.CalculateBeamTiltImage(ctf_of_image, output_phase_shifts);
|
|
844
|
+
return ctf_of_image;
|
|
845
|
+
})
|
|
846
|
+
.def("ContainsBlankEdges", &Image::ContainsBlankEdges)
|
|
847
|
+
.def("CorrectMagnificationDistortion", &Image::CorrectMagnificationDistortion)
|
|
848
|
+
.def("ApplyMask", [](Image &__inst, float cosine_edge_width, float weight_outside_mask, float low_pass_filter_outside, float filter_cosine_edge_width, float outside_mask_value, bool use_outside_mask_value)
|
|
849
|
+
{
|
|
850
|
+
::Image mask_file;
|
|
851
|
+
auto __ret = __inst.ApplyMask(mask_file, cosine_edge_width, weight_outside_mask, low_pass_filter_outside, filter_cosine_edge_width, outside_mask_value, use_outside_mask_value);
|
|
852
|
+
return std::make_tuple(__ret, mask_file);
|
|
853
|
+
})
|
|
854
|
+
.def("CenterOfMass", &Image::CenterOfMass)
|
|
855
|
+
.def("StandardDeviationOfMass", &Image::StandardDeviationOfMass)
|
|
856
|
+
.def("ReturnAverageOfMaxN", &Image::ReturnAverageOfMaxN)
|
|
857
|
+
.def("ReturnAverageOfMinN", &Image::ReturnAverageOfMinN)
|
|
858
|
+
.def("AddSlices", [](Image &__inst, int first_slice, int last_slice, bool calculate_average)
|
|
859
|
+
{
|
|
860
|
+
::Image sum_of_slices;
|
|
861
|
+
__inst.AddSlices(sum_of_slices, first_slice, last_slice, calculate_average);
|
|
862
|
+
return sum_of_slices;
|
|
863
|
+
})
|
|
864
|
+
.def("FindBeamTilt", [](Image &__inst, float pixel_size, float phase_multiplier, bool progress_bar, int first_position_to_search, int last_position_to_search, MyApp *app_for_result)
|
|
865
|
+
{
|
|
866
|
+
CTF input_ctf;
|
|
867
|
+
::Image phase_error_output;
|
|
868
|
+
::Image beamtilt_output;
|
|
869
|
+
::Image difference_image;
|
|
870
|
+
float beamtilt_x;
|
|
871
|
+
float beamtilt_y;
|
|
872
|
+
float particle_shift_x;
|
|
873
|
+
float particle_shift_y;
|
|
874
|
+
auto __ret = __inst.FindBeamTilt(input_ctf, pixel_size, phase_error_output, beamtilt_output, difference_image, beamtilt_x, beamtilt_y, particle_shift_x, particle_shift_y, phase_multiplier, progress_bar, first_position_to_search, last_position_to_search, app_for_result);
|
|
875
|
+
return std::make_tuple(__ret, input_ctf, phase_error_output, beamtilt_output, difference_image, beamtilt_x, beamtilt_y, particle_shift_x, particle_shift_y);
|
|
876
|
+
})
|
|
877
|
+
.def("ReturnVolumeInRealSpace", &Image::ReturnVolumeInRealSpace)
|
|
878
|
+
.def("ReturnReal1DAddressFromPhysicalCoord", &Image::ReturnReal1DAddressFromPhysicalCoord)
|
|
879
|
+
.def("ReturnRealPixelFromPhysicalCoord", &Image::ReturnRealPixelFromPhysicalCoord)
|
|
880
|
+
.def("ReturnFourier1DAddressFromPhysicalCoord", &Image::ReturnFourier1DAddressFromPhysicalCoord)
|
|
881
|
+
.def("ReturnFourier1DAddressFromLogicalCoord", &Image::ReturnFourier1DAddressFromLogicalCoord)
|
|
882
|
+
.def("ReturnComplexPixelFromLogicalCoord", &Image::ReturnComplexPixelFromLogicalCoord)
|
|
883
|
+
.def("HasSameDimensionsAs", &Image::HasSameDimensionsAs)
|
|
884
|
+
.def("IsCubic", &Image::IsCubic)
|
|
885
|
+
.def("IsSquare", &Image::IsSquare)
|
|
886
|
+
.def("ReturnCosineMaskBandpassResolution", [](Image &__inst, float pixel_size_in_angstrom)
|
|
887
|
+
{
|
|
888
|
+
float wanted_cutoff_in_angstrom;
|
|
889
|
+
float wanted_falloff_in_number_of_fourier_space_voxels;
|
|
890
|
+
__inst.ReturnCosineMaskBandpassResolution(pixel_size_in_angstrom, wanted_cutoff_in_angstrom, wanted_falloff_in_number_of_fourier_space_voxels);
|
|
891
|
+
return std::make_tuple(wanted_cutoff_in_angstrom, wanted_falloff_in_number_of_fourier_space_voxels);
|
|
892
|
+
})
|
|
893
|
+
.def("IsBinary", &Image::IsBinary)
|
|
894
|
+
.def("SetLogicalDimensions", &Image::SetLogicalDimensions)
|
|
895
|
+
.def("UpdateLoopingAndAddressing", &Image::UpdateLoopingAndAddressing)
|
|
896
|
+
.def("UpdatePhysicalAddressOfBoxCenter", &Image::UpdatePhysicalAddressOfBoxCenter)
|
|
897
|
+
.def("ReturnFourierLogicalCoordGivenPhysicalCoord_X", &Image::ReturnFourierLogicalCoordGivenPhysicalCoord_X)
|
|
898
|
+
.def("ReturnFourierLogicalCoordGivenPhysicalCoord_Y", &Image::ReturnFourierLogicalCoordGivenPhysicalCoord_Y)
|
|
899
|
+
.def("ReturnFourierLogicalCoordGivenPhysicalCoord_Z", &Image::ReturnFourierLogicalCoordGivenPhysicalCoord_Z)
|
|
900
|
+
.def("ReturnMaximumDiagonalRadius", &Image::ReturnMaximumDiagonalRadius)
|
|
901
|
+
.def("FourierComponentHasExplicitHermitianMate", &Image::FourierComponentHasExplicitHermitianMate)
|
|
902
|
+
.def("FourierComponentIsExplicitHermitianMate", &Image::FourierComponentIsExplicitHermitianMate)
|
|
903
|
+
.def("NormalizeFT", &Image::NormalizeFT)
|
|
904
|
+
.def("NormalizeFTAndInvertRealValues", &Image::NormalizeFTAndInvertRealValues)
|
|
905
|
+
.def("DivideByConstant", &Image::DivideByConstant)
|
|
906
|
+
.def("MultiplyByConstant", &Image::MultiplyByConstant)
|
|
907
|
+
.def("InvertRealValues", &Image::InvertRealValues)
|
|
908
|
+
.def("TakeReciprocalRealValues", &Image::TakeReciprocalRealValues)
|
|
909
|
+
.def("AddConstant", &Image::AddConstant)
|
|
910
|
+
.def("MultiplyAddConstant", &Image::MultiplyAddConstant)
|
|
911
|
+
.def("AddMultiplyConstant", &Image::AddMultiplyConstant)
|
|
912
|
+
.def("AddMultiplyAddConstant", &Image::AddMultiplyAddConstant)
|
|
913
|
+
.def("SquareRealValues", &Image::SquareRealValues)
|
|
914
|
+
.def("SquareRootRealValues", &Image::SquareRootRealValues)
|
|
915
|
+
.def("ExponentiateRealValues", &Image::ExponentiateRealValues)
|
|
916
|
+
.def("ReturnNumberofNonZeroPixels", &Image::ReturnNumberofNonZeroPixels)
|
|
917
|
+
.def("ForwardFFT", &Image::ForwardFFT)
|
|
918
|
+
.def("BackwardFFT", &Image::BackwardFFT)
|
|
919
|
+
.def("AddFFTWPadding", &Image::AddFFTWPadding)
|
|
920
|
+
.def("RemoveFFTWPadding", &Image::RemoveFFTWPadding)
|
|
921
|
+
//.def("ReadSlice", (void (Image::*)(MRCFile,long))&Image::ReadSlice)
|
|
922
|
+
/* .def("ReadSlice", (void (Image::*)(DMFile,long))&Image::ReadSlice)
|
|
923
|
+
.def("ReadSlice", (void (Image::*)(EerFile,long))&Image::ReadSlice)
|
|
924
|
+
.def("ReadSlice", (void (Image::*)(ImageFile,long))&Image::ReadSlice) */
|
|
925
|
+
//.def("ReadSlices", (void (Image::*)(MRCFile,long,long))&Image::ReadSlices)
|
|
926
|
+
/* .def("ReadSlices", (void (Image::*)(DMFile,long,long))&Image::ReadSlices)
|
|
927
|
+
.def("ReadSlices", (void (Image::*)(EerFile,long,long))&Image::ReadSlices)
|
|
928
|
+
.def("ReadSlices", (void (Image::*)(ImageFile,long,long))&Image::ReadSlices) */
|
|
929
|
+
.def("WriteSlice", &Image::WriteSlice)
|
|
930
|
+
.def("WriteSlices", &Image::WriteSlices)
|
|
931
|
+
.def("WriteSlicesAndFillHeader", &Image::WriteSlicesAndFillHeader)
|
|
932
|
+
.def("QuickAndDirtyWriteSlices", &Image::QuickAndDirtyWriteSlices)
|
|
933
|
+
.def("QuickAndDirtyWriteSlice", &Image::QuickAndDirtyWriteSlice)
|
|
934
|
+
.def("QuickAndDirtyReadSlice", &Image::QuickAndDirtyReadSlice)
|
|
935
|
+
.def("QuickAndDirtyReadSlices", &Image::QuickAndDirtyReadSlices)
|
|
936
|
+
.def("IsConstant", &Image::IsConstant)
|
|
937
|
+
.def("HasNan", &Image::HasNan)
|
|
938
|
+
.def("HasNegativeRealValue", &Image::HasNegativeRealValue)
|
|
939
|
+
.def("SetToConstant", &Image::SetToConstant)
|
|
940
|
+
.def("ClipIntoLargerRealSpace2D", &Image::ClipIntoLargerRealSpace2D)
|
|
941
|
+
.def("ClipInto", &Image::ClipInto)
|
|
942
|
+
.def("ChangePixelSize", &Image::ChangePixelSize)
|
|
943
|
+
.def("InsertOtherImageAtSpecifiedPosition", &Image::InsertOtherImageAtSpecifiedPosition)
|
|
944
|
+
.def("Resize", &Image::Resize)
|
|
945
|
+
.def("RealSpaceBinning", &Image::RealSpaceBinning)
|
|
946
|
+
.def("ReturnVarianceOfRealValuesTiled", &Image::ReturnVarianceOfRealValuesTiled)
|
|
947
|
+
.def("CopyFrom", &Image::CopyFrom)
|
|
948
|
+
.def("CopyLoopingAndAddressingFrom", &Image::CopyLoopingAndAddressingFrom)
|
|
949
|
+
.def("Consume", &Image::Consume)
|
|
950
|
+
.def("RealSpaceIntegerShift", &Image::RealSpaceIntegerShift)
|
|
951
|
+
.def("DilateBinarizedMask", &Image::DilateBinarizedMask)
|
|
952
|
+
.def("ErodeBinarizedMask", &Image::ErodeBinarizedMask)
|
|
953
|
+
.def("PhaseShift", &Image::PhaseShift)
|
|
954
|
+
.def("MakeAbsolute", &Image::MakeAbsolute)
|
|
955
|
+
.def("AddImage", &Image::AddImage)
|
|
956
|
+
.def("SubtractImage", &Image::SubtractImage)
|
|
957
|
+
.def("SubtractSquaredImage", &Image::SubtractSquaredImage)
|
|
958
|
+
.def("ApplyBFactor", &Image::ApplyBFactor)
|
|
959
|
+
.def("ApplyBFactorAndWhiten", [](Image &__inst, float bfactor_low, float bfactor_high, float bfactor_res_limit)
|
|
960
|
+
{
|
|
961
|
+
Curve power_spectrum;
|
|
962
|
+
__inst.ApplyBFactorAndWhiten(power_spectrum, bfactor_low, bfactor_high, bfactor_res_limit);
|
|
963
|
+
return power_spectrum;
|
|
964
|
+
})
|
|
965
|
+
.def("CalculateDerivative", &Image::CalculateDerivative)
|
|
966
|
+
.def("SharpenMap", &Image::SharpenMap)
|
|
967
|
+
.def("InvertHandedness", &Image::InvertHandedness)
|
|
968
|
+
.def("ApplyCTFPhaseFlip", &Image::ApplyCTFPhaseFlip)
|
|
969
|
+
.def("ApplyCTF", &Image::ApplyCTF)
|
|
970
|
+
.def("ApplyCurveFilter", &Image::ApplyCurveFilter)
|
|
971
|
+
.def("ApplyCurveFilterUninterpolated", &Image::ApplyCurveFilterUninterpolated)
|
|
972
|
+
.def("MaskCentralCross", &Image::MaskCentralCross)
|
|
973
|
+
.def("ZeroCentralPixel", &Image::ZeroCentralPixel)
|
|
974
|
+
.def("CalculateCrossCorrelationImageWith", &Image::CalculateCrossCorrelationImageWith)
|
|
975
|
+
.def("SwapRealSpaceQuadrants", &Image::SwapRealSpaceQuadrants)
|
|
976
|
+
.def("ComputeAmplitudeSpectrumFull2D", &Image::ComputeAmplitudeSpectrumFull2D)
|
|
977
|
+
.def("ComputeFilteredAmplitudeSpectrumFull2D", [](Image &__inst, Image *average_spectrum_masked, Image *current_power_spectrum, float minimum_resolution, float maximum_resolution, float pixel_size_for_fitting)
|
|
978
|
+
{
|
|
979
|
+
float average;
|
|
980
|
+
float sigma;
|
|
981
|
+
__inst.ComputeFilteredAmplitudeSpectrumFull2D(average_spectrum_masked, current_power_spectrum, average, sigma, minimum_resolution, maximum_resolution, pixel_size_for_fitting);
|
|
982
|
+
return std::make_tuple(average, sigma);
|
|
983
|
+
})
|
|
984
|
+
.def("ComputeAmplitudeSpectrum", &Image::ComputeAmplitudeSpectrum)
|
|
985
|
+
.def("ComputeHistogramOfRealValuesCurve", &Image::ComputeHistogramOfRealValuesCurve)
|
|
986
|
+
.def("Compute1DAmplitudeSpectrumCurve", &Image::Compute1DAmplitudeSpectrumCurve)
|
|
987
|
+
.def("Compute1DPowerSpectrumCurve", &Image::Compute1DPowerSpectrumCurve)
|
|
988
|
+
.def("Compute1DRotationalAverage", [](Image &__inst, bool fractional_radius_in_real_space, bool average_real_parts)
|
|
989
|
+
{
|
|
990
|
+
Curve average;
|
|
991
|
+
Curve number_of_values;
|
|
992
|
+
average.SetupXAxis(0.0, 0.5 * sqrtf(2.0), int((__inst.logical_x_dimension / 2.0 + 1.0) * sqrtf(2.0) + 1.0));
|
|
993
|
+
number_of_values.SetupXAxis(0.0, 0.5 * sqrtf(2.0), int((__inst.logical_x_dimension / 2.0 + 1.0) * sqrtf(2.0) + 1.0));
|
|
994
|
+
|
|
995
|
+
__inst.Compute1DRotationalAverage(average, number_of_values, fractional_radius_in_real_space, average_real_parts);
|
|
996
|
+
return std::make_tuple(average, number_of_values);
|
|
997
|
+
})
|
|
998
|
+
.def("ComputeSpatialFrequencyAtEveryVoxel", &Image::ComputeSpatialFrequencyAtEveryVoxel)
|
|
999
|
+
.def("AverageRadially", &Image::AverageRadially)
|
|
1000
|
+
.def("ComputeLocalMeanAndVarianceMaps", &Image::ComputeLocalMeanAndVarianceMaps)
|
|
1001
|
+
.def("SpectrumBoxConvolution", &Image::SpectrumBoxConvolution)
|
|
1002
|
+
.def("TaperEdges", &Image::TaperEdges)
|
|
1003
|
+
.def("ReturnAverageOfRealValues", &Image::ReturnAverageOfRealValues)
|
|
1004
|
+
.def("ReturnMedianOfRealValues", &Image::ReturnMedianOfRealValues)
|
|
1005
|
+
.def("ReturnAverageOfRealValuesOnEdges", &Image::ReturnAverageOfRealValuesOnEdges)
|
|
1006
|
+
.def("ReturnAverageOfRealValuesAtRadius", &Image::ReturnAverageOfRealValuesAtRadius)
|
|
1007
|
+
.def("ReturnAverageOfRealValuesInRing", &Image::ReturnAverageOfRealValuesInRing)
|
|
1008
|
+
.def("ReturnSigmaOfFourierValuesOnEdges", &Image::ReturnSigmaOfFourierValuesOnEdges)
|
|
1009
|
+
.def("ReturnSigmaOfFourierValuesOnEdgesAndCorners", &Image::ReturnSigmaOfFourierValuesOnEdgesAndCorners)
|
|
1010
|
+
.def("ReturnMaximumValue", &Image::ReturnMaximumValue)
|
|
1011
|
+
.def("ReturnMinimumValue", &Image::ReturnMinimumValue)
|
|
1012
|
+
.def("SetMaximumValue", &Image::SetMaximumValue)
|
|
1013
|
+
.def("SetMinimumValue", &Image::SetMinimumValue)
|
|
1014
|
+
.def("SetMinimumAndMaximumValues", &Image::SetMinimumAndMaximumValues)
|
|
1015
|
+
.def("Binarise", &Image::Binarise)
|
|
1016
|
+
.def("BinariseInverse", &Image::BinariseInverse)
|
|
1017
|
+
.def("ComputeAverageAndSigmaOfValuesInSpectrum", [](Image &__inst, float minimum_radius, float maximum_radius, int cross_half_width)
|
|
1018
|
+
{
|
|
1019
|
+
float average;
|
|
1020
|
+
float sigma;
|
|
1021
|
+
__inst.ComputeAverageAndSigmaOfValuesInSpectrum(minimum_radius, maximum_radius, average, sigma, cross_half_width);
|
|
1022
|
+
return std::make_tuple(average, sigma);
|
|
1023
|
+
})
|
|
1024
|
+
.def("SetMaximumValueOnCentralCross", &Image::SetMaximumValueOnCentralCross)
|
|
1025
|
+
.def("ApplyMirrorAlongY", &Image::ApplyMirrorAlongY)
|
|
1026
|
+
.def("InvertPixelOrder", &Image::InvertPixelOrder)
|
|
1027
|
+
.def("GetMinMax", [](Image &__inst)
|
|
1028
|
+
{
|
|
1029
|
+
float min_value;
|
|
1030
|
+
float max_value;
|
|
1031
|
+
__inst.GetMinMax(min_value, max_value);
|
|
1032
|
+
return std::make_tuple(min_value, max_value);
|
|
1033
|
+
})
|
|
1034
|
+
.def("RandomisePhases", &Image::RandomisePhases)
|
|
1035
|
+
.def("ReturnCorrelationBetweenTwoHorizontalLines", &Image::ReturnCorrelationBetweenTwoHorizontalLines)
|
|
1036
|
+
.def("ReturnCorrelationBetweenTwoVerticalLines", &Image::ReturnCorrelationBetweenTwoVerticalLines)
|
|
1037
|
+
.def("ContainsRepeatedLineEdges", &Image::ContainsRepeatedLineEdges)
|
|
1038
|
+
.def("GetCorrelationWithCTF", &Image::GetCorrelationWithCTF)
|
|
1039
|
+
.def("SetupQuickCorrelationWithCTF", [](Image &__inst, CTF ctf, int *addresses, float *spatial_frequency_squared, float *azimuth)
|
|
1040
|
+
{
|
|
1041
|
+
int number_of_values;
|
|
1042
|
+
double norm_image;
|
|
1043
|
+
double image_mean;
|
|
1044
|
+
__inst.SetupQuickCorrelationWithCTF(ctf, number_of_values, norm_image, image_mean, addresses, spatial_frequency_squared, azimuth);
|
|
1045
|
+
return std::make_tuple(number_of_values, norm_image, image_mean);
|
|
1046
|
+
})
|
|
1047
|
+
.def("QuickCorrelationWithCTF", &Image::QuickCorrelationWithCTF)
|
|
1048
|
+
.def("ReturnIcinessOfSpectrum", &Image::ReturnIcinessOfSpectrum)
|
|
1049
|
+
.def("GetRealValueByLinearInterpolationNoBoundsCheckImage", [](Image &__inst)
|
|
1050
|
+
{
|
|
1051
|
+
float x;
|
|
1052
|
+
float y;
|
|
1053
|
+
float interpolated_value;
|
|
1054
|
+
__inst.GetRealValueByLinearInterpolationNoBoundsCheckImage(x, y, interpolated_value);
|
|
1055
|
+
return std::make_tuple(x, y, interpolated_value);
|
|
1056
|
+
})
|
|
1057
|
+
.def("FindPeakAtOriginFast2D", &Image::FindPeakAtOriginFast2D)
|
|
1058
|
+
.def("FindPeakWithIntegerCoordinates", &Image::FindPeakWithIntegerCoordinates)
|
|
1059
|
+
.def("FindPeakWithParabolaFit", &Image::FindPeakWithParabolaFit)
|
|
1060
|
+
.def("SubSampleWithNoisyResampling", &Image::SubSampleWithNoisyResampling)
|
|
1061
|
+
.def("SubSampleMask", &Image::SubSampleMask)
|
|
1062
|
+
.def("Sine1D", &Image::Sine1D)
|
|
1063
|
+
.def("CreateOrthogonalProjectionsImage", &Image::CreateOrthogonalProjectionsImage);
|
|
1064
|
+
|
|
1065
|
+
#ifdef VERSION_INFO
|
|
1066
|
+
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
|
|
1067
|
+
#else
|
|
1068
|
+
m.attr("__version__") = "dev";
|
|
1069
|
+
#endif
|
|
1070
|
+
}
|