75 sprintf(tempLine,
" [--basis <basis_type=blobs>] ");
77 sprintf(tempLine,
"%s --basis <basis_type=blobs> ", prefix);
82 if (comment !=
nullptr)
83 sprintf(lineOut,
"%s : %s", tempLine, comment);
85 sprintf(lineOut,
"%s : Basis function to use for the reconstruction", tempLine);
92 program->
addParamsLine(
" blobs <radius=2> <Bessel_order=2> <alpha_param=10.4> : Default blob parameters and grid relative size adjusted to use small blobs");
95 program->
addParamsLine(
" or --big_blobs : blob parameters and grid relative size adjusted to use big blobs (r=2, m=2, alpha=2.26, g=2.26)");
96 program->
addParamsLine(
" or --visual_blobs : blobs optimal for direct visualization (r=2.4, m=2, alpha=13.3633, g=1.41)");
97 program->
addParamsLine(
" or --tomo_blobs : blobs with high overlapping (r=3.469269, m=2, alpha=13.7385, g=1/sqrt(2))");
104 if (basisType ==
"blobs")
121 else if (program->
checkParam(
"--visual_blobs"))
139 if (basisType ==
"voxels")
144 else if (basisType ==
"splines")
213 std::cout <<
"Sum of a basis on the grid=" <<
sum_on_grid << std::endl;
214 std::cout <<
"D\n" <<
D << std::endl;
217 save.write(
"footprint.xmp");
228 out <<
" Blobs: radius=" << basis.
blob.
radius <<
" pixels" 230 <<
" order=" << basis.
blob.
order << std::endl;
250 return sqrt(3.0) * 0.5;
253 return sqrt(3.0) * 2.0;
262 int Zdim,
int Ydim,
int Xdim,
int threads )
const 273 *vol_voxels = vol_basis(0)();
274 xdiff = (Xdim -
XSIZE(*vol_voxels)) / 2;
275 ydiff = (Ydim -
YSIZE(*vol_voxels)) / 2;
276 zdiff = (Zdim -
ZSIZE(*vol_voxels)) / 2;
305 grid_type, grid_relative_size, 0.05, vol_mask,
306 D, 0.01, 0, R, threads);
315 vol_basis(0)() = vol_voxels;
319 vol_basis(0)()(
k,
i,
j) = 0;
320 if (vol_mask !=
nullptr)
322 if ((*vol_mask)(
k,
i,
j) == 0)
323 vol_basis(0)()(
k,
i,
j) = 0;
345 if (-0.5 <=
XX(r) &&
XX(r) < 0.5 &&
346 -0.5 <=
YY(r) &&
YY(r) < 0.5 &&
347 -0.5 <=
ZZ(r) &&
ZZ(r) < 0.5)
355 if (-2 <=
XX(r) &&
XX(r) < 2 &&
356 -2 <=
YY(r) &&
YY(r) < 2 &&
357 -2 <=
ZZ(r) &&
ZZ(r) < 2)
412 double Rmax2=Rmax*Rmax;
413 double iRmax=1.0/Rmax;
432 A3D_ELEM(Vbasis,k,i,j)=
ZernikeSphericalHarmonics(l1,n,l2,m,jr,ir,kr,
sqrt(r2)*iRmax);
void selfWindow(int n0, int z0, int y0, int x0, int nF, int zF, int yF, int xF, T init_value=0)
void createZernike3DBasis(const MultidimArray< double > &Vin, MultidimArray< double > &Vbasis, int l1, int n, int l2, int m, int Rmax)
double alpha
Smoothness parameter.
Case or algorithm not implemented yet.
double getDoubleParam(const char *param, int arg=0)
#define REPORT_ERROR(nerr, ErrormMsg)
void blobs2voxels(const GridVolume &vol_blobs, const struct blobtype &blob, MultidimArray< double > *vol_voxels, const Matrix2D< double > *D, int threads, int Zdim, int Ydim, int Xdim)
SimpleGrid Create_CC_grid(double relative_size, const Matrix1D< double > &corner1, const Matrix1D< double > &corner2, const Matrix1D< double > &origin)
double projectionAt(const Matrix1D< double > &u, const Matrix1D< double > &r) const
double grid_relative_size
Relative size for the grid.
void init(int _umin, int _umax, int _uistep, int _vmin, int _vmax, int _vistep, int _wmin=0, int _wmax=0, int _wistep=1)
void sqrt(Image< double > &op)
Basis()
Empty constructor. By default, blobs.
void changeFromVoxels(const MultidimArray< double > &vol_voxels, GridVolume &vol_basis, int grid_type, double grid_relative_size, const MultidimArray< double > *vol_mask, const Matrix2D< double > *D, double R, int threads=1) const
double sum_on_grid
Sum of the basis on the grid points.
double spatial_Bspline03LUT(const Matrix1D< double > &r)
struct blobtype blob
Blob parameters.
void convolutionFFTStack(const MultidimArray< double > &img, const MultidimArray< double > &kernel, MultidimArray< double > &result)
tBasisFunction type
Basis function to use.
ImageOver blobprint2
Square of the footprint.
void setDefault()
Default values.
void changeToVoxels(GridVolume &vol_basis, MultidimArray< double > *vol_voxels, int Zdim, int Ydim, int Xdim, int threads=1) const
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
void adapt_to_grid(const Grid &_grid)
#define A3D_ELEM(V, k, i, j)
#define FOR_ALL_ELEMENTS_IN_ARRAY3D(V)
double sum_blob_Grid(const struct blobtype &blob, const Grid &grid, const Matrix2D< double > *D)
const char * getParam(const char *param, int arg=0)
MultidimArray< double > * VolPSF
Footprint is convolved with a volume PSF // At this moment only used with blobs.
void voxels2blobs(const MultidimArray< double > *vol_voxels, const struct blobtype &blob, GridVolume &vol_blobs, int grid_type, double grid_relative_size, double lambda, const MultidimArray< double > *vol_mask, const Matrix2D< double > *D, double final_error_change, int tell, double R, int threads)
String basisName() const
Basis name.
double intersection_unit_cube(const Matrix1D< double > &u, const Matrix1D< double > &r)
Matrix1D< double > aux
Auxiliary vector for projections.
double valueAt(const Matrix1D< double > &r) const
void footprint_blob(ImageOver &blobprint, const struct blobtype &blob, int istep, int normalise)
void produceSideInfo(const Grid &grid)
#define blob_proj(r, blob)
void spatial_Bspline032voxels(const GridVolume &vol_splines, MultidimArray< double > *vol_voxels, int Zdim, int Ydim, int Xdim)
#define VECTOR_R3(v, x, y, z)
int order
Derivation order and Bessel function order.
static void defineParams(XmippProgram *program, const char *prefix=NULL, const char *comment=NULL)
double sum_spatial_Bspline03_Grid(const Grid &grid)
void resizeNoCopy(int Xdim)
double spatial_Bspline03_proj(const Matrix1D< double > &r, const Matrix1D< double > &u)
bool checkParam(const char *param)
const int BLOB_SUBSAMPLING
const int PIXEL_SUBSAMPLING
void readParams(XmippProgram *program)
void initZeros(const MultidimArray< T1 > &op)
#define blob_val(r, blob)
int getIntParam(const char *param, int arg=0)
Incorrect value received.
double radius
Spatial radius in Universal System units.
friend std::ostream & operator<<(std::ostream &out, const Basis &basis)
Show.
void addParamsLine(const String &line)
ImageOver blobprint
Blob footprint.
void setSamplingRate(double _Tm)