void
-__lmrcImageWindowingDolphChebychevWindow(mrcImage* dst, mrcImage* src, lmrcImageWindowingInfo* info, long mode)
+__lmrcImageWindowingDolphChebyshevWindow(mrcImage* dst, mrcImage* src, lmrcImageWindowingInfo* info, long mode)
{
mrcImageParaTypeReal x, y, z;
mrcImageParaTypeReal rx, ry, rz;
mrcImageParaTypeReal rx, ry, rz;
double data;
double weightx, weighty;
- double WxMin, WxMax, Wx;
- double WyMin, WyMax, Wy;
-
-
- fprintf(stderr, "Not supported yet\n");
- exit(EXIT_FAILURE);
+ double Wx, Cx;
+ double Wy, Cy;
if(src->HeaderN.z!=1) {
fprintf(stderr, "Not supported N.z : %d\n", src->HeaderN.z);
return;
}
- Wx = 1.0 - 2*info->Wx;
- Wy = 1.0 - 2*info->Wy;
-
+ Wx = (0.5 - info->Wx)*src->HeaderN.x;
+ Wy = (0.5 - info->Wy)*src->HeaderN.y;
+ Cx = (src->HeaderN.x-1)/2.0;
+ Cy = (src->HeaderN.y-1)/2.0;
+
for(x=0; x<src->HeaderN.x; x++) {
- rx = (x-(src->HeaderN.x-1)/2.0)/(src->HeaderN.x*Wx);
+ rx = (x-Cx)/Wx;
+ weightx = exp(-SQR(rx)/2.0);
for(y=0; y<src->HeaderN.y; y++) {
- ry = (y-(src->HeaderN.y-1)/2.0)/(src->HeaderN.y*Wy);
+ ry = (y-Cy)/Wy;
+ weighty = exp(-SQR(ry)/2.0);
- if(x<WxMin || WxMax <x
- ||y<WyMin || WyMax <y) {
- data = info->Offset;
- } else {
- weightx = 1;
- weighty = 1;
- mrcPixelDataGet(src, x, y, 0.0, &data, mrcPixelMag, mrcPixelHowNearest);
- data = weightx*weighty*(data - info->Offset) + info->Offset;
- }
+ mrcPixelDataGet(src, x, y, 0.0, &data, mrcPixelMag, mrcPixelHowNearest);
+ data = weightx*weighty*(data - info->Offset) + info->Offset;
mrcPixelDataSet(dst, x, y, 0.0, data, mrcPixelMag);
}
}
mrcImageParaTypeReal rx, ry, rz;
double data;
double weightx, weighty;
- double WxMin, WxMax, Wx;
- double WyMin, WyMax, Wy;
-
-
- fprintf(stderr, "Not supported yet\n");
- exit(EXIT_FAILURE);
+ double Wx, Cx;
+ double Wy, Cy;
if(src->HeaderN.z!=1) {
fprintf(stderr, "Not supported N.z : %d\n", src->HeaderN.z);
return;
}
- Wx = 1.0 - 2*info->Wx;
- Wy = 1.0 - 2*info->Wy;
-
+ Wx = (0.5 - info->Wx)*src->HeaderN.x;
+ Wy = (0.5 - info->Wy)*src->HeaderN.y;
+ Cx = (src->HeaderN.x-1)/2.0;
+ Cy = (src->HeaderN.y-1)/2.0;
+
for(x=0; x<src->HeaderN.x; x++) {
- rx = (x-(src->HeaderN.x-1)/2.0)/(src->HeaderN.x*Wx);
+ rx = (x-Cx)/Wx;
+ weightx = exp(-fabs(rx));
for(y=0; y<src->HeaderN.y; y++) {
- ry = (y-(src->HeaderN.y-1)/2.0)/(src->HeaderN.y*Wy);
+ ry = (y-Cy)/Wy;
+ weighty = exp(-fabs(ry));
- if(x<WxMin || WxMax <x
- ||y<WyMin || WyMax <y) {
- data = info->Offset;
- } else {
- weightx = 1;
- weighty = 1;
- mrcPixelDataGet(src, x, y, 0.0, &data, mrcPixelMag, mrcPixelHowNearest);
- data = weightx*weighty*(data - info->Offset) + info->Offset;
- }
+ mrcPixelDataGet(src, x, y, 0.0, &data, mrcPixelMag, mrcPixelHowNearest);
+ data = weightx*weighty*(data - info->Offset) + info->Offset;
mrcPixelDataSet(dst, x, y, 0.0, data, mrcPixelMag);
}
}
-/bin/bash: mrcImageWindowing: No such file or directory
+<HTML>
+<HEAD>
+<TITLE>mrcImageWindowing</TITLE>
+</HEAD>
+<BODY>
+<H1>mrcImageWindowing</H1>
+<H2>Usage</H2>
+<PRE>
+Usage: mrcImageWindowing
+Options:
+ [-i[nput] In (NULL ).as(inFile ) ] :Essential :InputDataFile
+ [-o[utput] Out (NULL ).as(outFile ) ] :Essential :OutputDataFile
+ [-W[indowing] Wx (0.1 ).as(Real )
+ WxMax (0.0 ).as(Real )
+ Wy (0.1 ).as(Real )
+ WyMax (0.0 ).as(Real ) ] :Optional :Windowsing Size:
+ [-W[indowing]x WX (0.1 ).as(Real ) ] :Optional :Windowsing Size:
+ [-W[indowing]y WY (0.1 ).as(Real ) ] :Optional :Windowsing Size:
+ [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
+ [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
+>>> Mode
+ 0: If 0<x<0.1*nx or 0.9*nx<x<nx, then cos windowing, else original.
+0: Cos Window (Fixed)
+ 90% windowing: fixed.
+1: Cos Window (Y-variable)
+ Wy: Settings: variable.
+2: Cos Window XY-variable
+ WxMax and Wx
+ WyMax and Wy Settings: variables
+ x/Nx < WxMax or 1-WxMax < x/Nx : 0
+ WxMax < x/Nx < Wx or 1-Wx < x/Nx < 1-WxMax : cos window
+ Wx < x/Nx < 1-Wx : 1
+ Wy and WyMax are also used for windowing in the similar manner.
+ In general, this is called Tukey window.
+3: Rectangle Window
+4: Hanning Window
+5: Hamming Window
+6: Blackman Window
+7: Dolph-Chebyshev Window
+8: Kaiser Window
+9: Gauss Window
+10: Exponentail Window
+>> Boundary
++0 : To Zero.
++16: Contrast down around mean.
+</PRE>
+</BODY>
+</HTML>