69 addParamsLine(
" : For 3D volumes: a symmetry file or point-group description");
71 addParamsLine(
" : C1, Ci, Cs, Cn (from here on n must be an integer number with no more than 2 digits)");
72 addParamsLine(
" : Cnv, Cnh, Sn, Dn, Dnv, Dnh, T, Td, Th, O, Oh");
73 addParamsLine(
" : I, I1, I2, I3, I4, I5, Ih, helical, dihedral, helicalDihedral");
74 addParamsLine(
" :+ For a full description of symmetries look at");
75 addParamsLine(
" :+ http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/Symmetry");
76 addParamsLine(
" [--sym2 <sym2=C1>] : Only for helical, or helicalDihedral");
78 addParamsLine(
" [--helixParams <z> <rot> <rotPhase=0>]: Helical parameters z(Angstroms), rot(degrees), rotPhase(degrees)");
79 addParamsLine(
" :+ V(r,theta,z)=V(r,theta+rotHelix+rotPhase,z+zHelix)");
80 addParamsLine(
" [--heightFraction <f=0.95>]: Height fraction used for symmetrizing a helix");
81 addParamsLine(
" [--sampling <T=1>] : Sampling rate (A/pixel). Used only for helical parameters");
82 addParamsLine(
" [--no_group] : For 3D volumes: do not generate symmetry subgroup");
83 addParamsLine(
" [--dont_wrap] : by default, the image/volume is wrapped");
84 addParamsLine(
" [--sum] : compute the sum of the images/volumes instead of the average. This is useful for symmetrizing pieces");
85 addParamsLine(
" [--mask_in <fileName>]: symmetrize only in the masked area");
86 addParamsLine(
" [--spline <order=3>] : Spline order for the interpolation (valid values are 1 and 3)");
87 addExampleLine(
"Symmetrize a list of images with 6 fold symmetry",
false);
88 addExampleLine(
" xmipp_transform_symmetrize -i input.sel --sym 6");
89 addExampleLine(
"Symmetrize with i3 symmetry and the volume is not wrapped",
false);
90 addExampleLine(
" xmipp_transform_symmetrize -i input.vol --sym i3 --dont_wrap");
100 <<
"Symmetry: " <<
fn_sym << std::endl
102 <<
"Wrap: " <<
wrap << std::endl
103 <<
"Sum: " <<
sum << std::endl
106 std::cout <<
"mask_in " <<
fn_Maskin << std::endl;
113 std::cout <<
"Symmetry2: " <<
fn_sym2 << std::endl;
141 if (!helical && !dihedral && !helicalDihedral)
162 arrayByArray(V_out, V_aux, V_out,
'+');
164 selfArrayByArrayMask(V_in, V_aux, V_out,
'+', mask);
168 arrayByScalar(V_out, 1.0/(SL.
symsNo() + 1.0f), V_out,
'*');
171 symmetry_Helical(V_out,V_in,zHelical,rotHelical,rotPhaseHelical,
nullptr,
false,heightFraction,Cn);
172 else if (helicalDihedral)
174 symmetry_Helical(V_out,V_in,zHelical,rotHelical,rotPhaseHelical,
nullptr,
true,heightFraction,Cn);
176 rotate(spline,Vrotated,V_out,180.0,
'X',xmipp_transformation::WRAP);
182 auto zmax=(int)(0.1*
ZSIZE(V_in));
189 bool wrap,
bool do_outside_avg,
bool sum,
209 rotate(spline, rotatedImg, I_in, 360.0 / symorder *
i,
'Z',wrap,avg);
241 Iin().setXmippOrigin();
242 Iout().resize(Iin());
269 Iout.
write(fnImgOut);
Case or algorithm not implemented yet.
double getDoubleParam(const char *param, int arg=0)
void getMatrices(int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const
bool wrap
wrap or don't wrap input file during symmetrisation
#define REPORT_ERROR(nerr, ErrormMsg)
double Ts
Sampling rate (used for helical)
void resizeNoCopy(const MultidimArray< T1 > &v)
void symmetrizeVolume(const SymList &SL, const MultidimArray< double > &V_in, MultidimArray< double > &V_out, int spline, bool wrap, bool do_outside_avg, bool sum, bool helical, bool dihedral, bool helicalDihedral, double rotHelical, double rotPhaseHelical, double zHelical, double heightFraction, const MultidimArray< double > *mask, int Cn)
double zHelical
Helical shift.
double rotHelical
Helical rotation.
void BinaryCircularMask(MultidimArray< int > &mask, double radius, int mode, double x0, double y0, double z0)
int splineOrder
Spline order.
int readSymmetryFile(FileName fn_sym, double accuracy=SYM_ACCURACY)
double rotPhaseHelical
Helical phase.
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
void symmetry_Dihedral(MultidimArray< double > &Vout, const MultidimArray< double > &Vin, double rotStep, double zmin, double zmax, double zStep, MultidimArray< int > *mask)
Matrix2D< T > transpose() const
int readApplyGeo(const FileName &name, const MDRow &row, const ApplyGeoParams ¶ms=DefaultApplyGeoParams)
#define rotate(a, i, j, k, l)
void computeStats_within_binary_mask(const MultidimArray< T1 > &mask, const MultidimArray< T > &m, double &min_val, double &max_val, double &avg, double &stddev)
void symmetrizeImage(int symorder, const MultidimArray< double > &I_in, MultidimArray< double > &I_out, int spline, bool wrap, bool do_outside_avg, bool sum, const MultidimArray< double > *mask)
const char * getParam(const char *param, int arg=0)
Incorrect argument received.
void symmetry_Helical(MultidimArray< double > &Vout, const MultidimArray< double > &Vin, double zHelical, double rotHelical, double rot0, MultidimArray< int > *mask, bool dihedral, double heightFraction, int Cn)
bool sum
Sum or average the result.
double heightFraction
Helical height fraction.
void addExampleLine(const char *example, bool verbatim=true)
int verbose
Verbosity level.
FileName fn_sym
symmetry file
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
Process image or volume.
int Cn
Cn for helical or helicalDihedral.
int textToInteger(const char *str)
bool checkParam(const char *param)
constexpr int OUTSIDE_MASK
bool do_not_generate_subgroup
Do not generate subgroup.
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void addUsageLine(const char *line, bool verbatim=false)
FileName fn_Maskin
mask file (mask what is inside)
int getIntParam(const char *param, int arg=0)
bool doMask
set to true is we should mask
void addParamsLine(const String &line)