「ctfInfo(API)」の版間の差分

提供: Eospedia
移動: 案内検索
(シグナル関数)
(ctfInfo)
 
(2人の利用者による、間の7版が非表示)
行125: 行125:
  
 
== 構造体 ==
 
== 構造体 ==
 +
 +
 +
 +
分子のエンベロープ関連で使用
 
  typedef struct moleculrEnvelope {
 
  typedef struct moleculrEnvelope {
 
  char* filename;  
 
  char* filename;  
行132: 行136:
 
  int    mode;
 
  int    mode;
 
  } molecularEnvelope;
 
  } molecularEnvelope;
 +
 +
=== ctfInfo ===
 +
 +
CTFを計算する上で必要なパラメータになります。
 +
 +
電子顕微鏡や照射条件により決まるもの
 +
<table border=1>
 +
<tr><td> kV <td> [kV] <td> 加速電圧(電子線の加速電圧、単位はkV)
 +
<tr><td> Cc <td> [mm] <td> 色収差係数(単位はmm)
 +
<tr><td> dE <td>  <td> エネルギーの揺らぎ幅(色収差を使った包絡関数の計算に必要)
 +
<tr><td> Cs <td> [mm] <td> 球面収差係数(単位はmm)
 +
<tr><td> Ain <td> [mrad] <td> 照射半角(単位はmrad)(球面収差係数やデフォーカスによる包絡関数の計算に必要)(ファイル上ではAiとして表示)
 +
</table>
 +
 +
デフォーカスにより決まるもの
 +
<table border=1>
 +
<tr><td> defocus <td> [A] <td> デフォーカス量(単位はオングストーローム、正がアンダーフォーカス)
 +
<tr><td> flagAstigmatism <td> Integer <td> 非点を考慮するかどうかのフラグ(0:考慮しない、1:考慮する)
 +
<tr><td> defocus2D float[2]<td> [A] <td> デフォーカス量
 +
</table>
 +
 +
試料(シグナル)によって決まるもの
 +
<table border=1>
 +
<tr><td> I0 <td> <td> シグナル強度
 +
<tr><td> Isignal <td> <td> シグナル強度
 +
<tr><td> Inoise <td> <td> ノイズ強度
 +
<tr><td> flagWhiteNoise <td> Integer <td> ホワイトノイズ(MTFにより影響を受ける成分)
 +
<tr><td> WhiteNoise <td> <td> ノイズ強度
 +
<tr><td> flagWhiteNoiseRasing <td> Integer <td> ホワイトノイズのMTFの落ちを考慮するかどうか
 +
<tr><td> WhiteNoiseRasing <td> <td> MTFによりノイズが崩落する成分
 +
 +
</table>
 +
 +
解析の際に利用する量
 +
<table border=1>
 +
<tr> <td> flagWin <td> Integer <td> 窓関数をかけるかどうかのフラグ(0:かけない、1:かける)
 +
<tr> <td> CutLow <td> A-1  <td> 窓関数の低周波側のエッジ
 +
<tr> <td> CutHigh <td> A-1 <td> 窓関数の高周波側のエッジ
 +
</table>
 +
  
 
各APIの引数として使用する設定
 
各APIの引数として使用する設定
行225: 行269:
  
 
== API ==
 
== API ==
extern void ctfInfoSendByPVM(ctfInfo* info, int tid, long mode);
+
==== スキャッタリング ====
extern void ctfInfoRecieveByPVM(ctfInfo* info, int tid, long mode);
+
extern float ctfNoise2Function(ctfInfo* info, float R, long mode);
+
extern float ctfSignalPowerFunction(ctfInfo* info, float R, long mode);
+
extern float ctfNoisePowerFunction(ctfInfo* info, float R, long mode);
+
extern float ctfNoise2PowerFunction(ctfInfo* info, float R, long mode);
+
 
+
==== scattering ====
+
extern float ctfScatteringFunction(ctfInfo* info, float R, long mode);
+
 
シグナル(ctfSignalFunctionより)にノイズ(ctfNoiseFunctionより)を加えたときの値を返します。
 
シグナル(ctfSignalFunctionより)にノイズ(ctfNoiseFunctionより)を加えたときの値を返します。
 +
extern float ctfScatteringFunction(ctfInfo* info, float R, long mode);
  
==== シグナル関数 ====
+
==== シグナル ====
 
+
シグナルを出力<br>
info->flagAliasing=true: エイリアシングを加えます。(info->NyquistFrequencyによる)
+
(ctfFunction, ctfMolecularEnvelopeFunction, ctfMolecularEnvelopeInElasticFunction, ctfVibrationFunction, ctfMTFFunctionを使用)<br>
 +
info->flagAliasing=trueのとき: エイリアシングを加えます。(info->NyquistFrequencyによる)
 
  extern float ctfSignalFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfSignalFunction(ctfInfo* info, float R, long mode);
  
==== ノイズ関数 ====
+
上記のシグナルを強度で出力
ホワイトノイズ(info->WhiteNoise)や[[MTF]](ctfMTFFunctionより)などを掛け合わせて算出したノイズ関数を出力します。<br>
+
  extern float ctfSignalPowerFunction(ctfInfo* info, float R, long mode);
info->flagAliasing=true: エイリアシングを加えます。(info->NyquistFrequencyを使用)
+
  extern float ctfNoiseFunction(ctfInfo* info, float R, long mode);
+
  
 +
===== 分子のエンベロープを算出 =====
 +
info->flagMolecEnvTable=trueのときはlmolecularEnvelopeDataGetを呼び出して、テーブル(info->MolecEnvTable)を元に算出
 
  extern float ctfMolecularEnvelopeFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfMolecularEnvelopeFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfMolecularEnvelopeInElasticFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfMolecularEnvelopeInElasticFunction(ctfInfo* info, float R, long mode);
 +
 +
==== ノイズ ====
 +
ホワイトノイズ(info->WhiteNoise)や[[MTF]](ctfMTFFunctionより)などを掛け合わせて算出したノイズを出力<br>
 +
info->flagAliasing=trueのとき: エイリアシングを加えます。(info->NyquistFrequencyによる)
 +
extern float ctfNoiseFunction(ctfInfo* info, float R, long mode);
 +
 +
上記のノイズを強度で出力
 +
extern float ctfNoisePowerFunction(ctfInfo* info, float R, long mode);
 +
 +
ホワイトノイズにinfo->WhiteNoise2を使用して、ノイズを出力
 +
extern float ctfNoise2Function(ctfInfo* info, float R, long mode);
 +
 +
上記のノイズを強度で出力
 +
extern float ctfNoise2PowerFunction(ctfInfo* info, float R, long mode);
  
 
==== 振動関数の算出 ====
 
==== 振動関数の算出 ====
Rによる振動関数の値を算出します。<br>
+
Rによる振動関数の値を算出<br>
 
info->Magnification: Rの倍率
 
info->Magnification: Rの倍率
 
  extern float ctfVibrationFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfVibrationFunction(ctfInfo* info, float R, long mode);
行258: 行310:
 
==== [[CTF]]の算出 ====
 
==== [[CTF]]の算出 ====
 
  extern float ctfFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfFunction(ctfInfo* info, float R, long mode);
Rによる[[CTF]]の値を算出します。<br>
+
Rによる[[CTF]]の値を算出<br>
 
電子線の波長: wavelengthOfElectronより算出<br>
 
電子線の波長: wavelengthOfElectronより算出<br>
 
コントラスト: info->modeにより算出方法を設定
 
コントラスト: info->modeにより算出方法を設定
行280: 行332:
  
 
===== 2Dの場合 =====
 
===== 2Dの場合 =====
ctfFunctionを呼び出して2Dでの[[CTF]]を算出(X, YからRを求めて引数とする)
+
X, YからRを求めて引数としてctfFunctionを呼び出す
 
  extern float ctfFunction2D(ctfInfo* info, float X, float Y, long mode);
 
  extern float ctfFunction2D(ctfInfo* info, float X, float Y, long mode);
 
===== PVM使用時 =====
 
extern void  ctfFunctionPVMStart(ctfInfo* info, float R, int tid, long mode);
 
extern float ctfFunctionPVMEnd(ctfInfo* info, float R, int tid, long mode);
 
extern void  ctfFunctionPVMServer();
 
  
 
==== Envelope関数の算出 ====
 
==== Envelope関数の算出 ====
 
  extern float ctfEnvelopFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfEnvelopFunction(ctfInfo* info, float R, long mode);
Rによるenvelope関数の値を算出します。<br>
+
Rによるエンベロープ関数の値を算出<br>
 
wavelengthOfElectronにより電子線の波長を取得<br>
 
wavelengthOfElectronにより電子線の波長を取得<br>
 
info->flagMagnification=1のとき: info->Magnification(0以外で)をRの倍率として掛ける
 
info->flagMagnification=1のとき: info->Magnification(0以外で)をRの倍率として掛ける
行321: 行368:
 
==== [[MTF]]の算出 ====
 
==== [[MTF]]の算出 ====
 
  extern float ctfMTFFunction(ctfInfo* info, float R, long mode);
 
  extern float ctfMTFFunction(ctfInfo* info, float R, long mode);
Rによる[[MTF]]の値を算出します。<br>
+
Rによる[[MTF]]の値を算出<br>
 
info->Magnification: 引数Rの倍率<br>
 
info->Magnification: 引数Rの倍率<br>
 
info->flagSampling=1のとき: 標本化関数を積算(ctfFunctionSamplingを呼び出す: info->NyquistFrequencyを第2引数(ナイキスト)とする)
 
info->flagSampling=1のとき: 標本化関数を積算(ctfFunctionSamplingを呼び出す: info->NyquistFrequencyを第2引数(ナイキスト)とする)
行373: 行420:
  
 
==== 標本化関数の算出 ====
 
==== 標本化関数の算出 ====
Rによる標本化関数の値を算出します。
+
Rによる標本化関数の値を算出
 
  extern float ctfFunctionSampling(float R, float Nyquist, long mode);
 
  extern float ctfFunctionSampling(float R, float Nyquist, long mode);
  
行401: 行448:
 
<br>
 
<br>
  
extern float ctfWeightForCorrection2D(ctfInfo* info, float X, float Y, long mode);
+
==== CTF補正時の重みの算出 ====
 +
CTF補正で使用する重みを出力
 
  extern float ctfWeightForCorrection(ctfInfo* info, float R, long mode);
 
  extern float ctfWeightForCorrection(ctfInfo* info, float R, long mode);
 +
<table border="1">
 +
<div align="left">
 +
<tr>
 +
<th>mode</th>
 +
<th>説明</th>
 +
</tr>
 +
<tr>
 +
<td>0</td>
 +
<td>1を返す(補正無し)</td>
 +
</tr>
 +
<tr>
 +
<td>1</td>
 +
<td>ctf/|ctf| (逆位相)</td>
 +
</tr>
 +
<tr>
 +
<td>2</td>
 +
<td>ctf (逆位相 x CTF補正)</td>
 +
</tr>
 +
<tr>
 +
<td>3</td>
 +
<td>1/ctf    (0.1<|ctf| ) (CTF補正 / 逆位相)</td>
 +
</tr>
 +
<tr>
 +
<td>4</td>
 +
<td>ctf/(SQR(ctf)+SQR(NS))    phase-flipping + Winner Filtering</td>
 +
</tr>
 +
<tr>
 +
<td>5</td>
 +
<td>SQR(ctf) x ctf/|ctf|      phase-flipping + ctf-Weighted</td>
 +
</tr>
 +
<tr>
 +
<td>6</td>
 +
<td>1/|ctf|  (0.1<|ctf|)      No phase-flipping + ctf-divided</td>
 +
</tr>
 +
<tr>
 +
<td>7</td>
 +
<td>|ctf|/(SQR(ctf)+SQR(NS))  No phase flipping + Winner Filtering </td>
 +
</tr>
 +
</div>
 +
</table>
 +
<br>
 +
 +
===== 2Dの場合 =====
 +
X, YからRを求めて引数としてctfWeightForCorrectionを呼び出す
 +
extern float ctfWeightForCorrection2D(ctfInfo* info, float X, float Y, long mode);
 +
 +
==== 分子のエンベロープ ====
 +
ファイル読み込み
 
  extern void lmolecularEnvelopeFileRead(FILE* fpt, molecularEnvelope* mol, int mode);
 
  extern void lmolecularEnvelopeFileRead(FILE* fpt, molecularEnvelope* mol, int mode);
 +
ファイル書き出し
 
  extern void lmolecularEnvelopeFileWrite(FILE* fpt, molecularEnvelope* mol, int mode);
 
  extern void lmolecularEnvelopeFileWrite(FILE* fpt, molecularEnvelope* mol, int mode);
 +
リサンプリング
 
  extern void lmolecularEnvelopeResampling(molecularEnvelope* dst, molecularEnvelope* src, float dR, float RMax, int mode);
 
  extern void lmolecularEnvelopeResampling(molecularEnvelope* dst, molecularEnvelope* src, float dR, float RMax, int mode);
 +
srcにおけるRのエンベロープ値を取得
 
  extern float lmolecularEnvelopeDataGet(molecularEnvelope* src, float R, int mode);
 
  extern float lmolecularEnvelopeDataGet(molecularEnvelope* src, float R, int mode);
 +
 +
==== CTF情報 ====
 +
ファイル読み込み
 
  extern void ctfInfoRead(FILE* fpt, ctfInfo* ctf, char* pre, int mode);
 
  extern void ctfInfoRead(FILE* fpt, ctfInfo* ctf, char* pre, int mode);
 +
ファイル書き出し
 
  extern void ctfInfoWrite(FILE* fpt, ctfInfo ctf, char* pre, int mode);
 
  extern void ctfInfoWrite(FILE* fpt, ctfInfo ctf, char* pre, int mode);
 +
 +
==== PVMインストール時のみ使用可 ====
 +
extern void ctfInfoSendByPVM(ctfInfo* info, int tid, long mode);
 +
extern void ctfInfoRecieveByPVM(ctfInfo* info, int tid, long mode);
 +
extern void  ctfFunctionPVMStart(ctfInfo* info, float R, int tid, long mode);
 +
extern float ctfFunctionPVMEnd(ctfInfo* info, float R, int tid, long mode);
 +
extern void  ctfFunctionPVMServer();
  
 
==== ヘルプ ====
 
==== ヘルプ ====
 
  extern void ctfWeightForCorrectionUsage(FILE* fpt);
 
  extern void ctfWeightForCorrectionUsage(FILE* fpt);

2015年11月18日 (水) 06:22時点における最新版

DataManip/ctfInfoCTFの推定及びCTF補正のためのAPI です。

定数

モード選択

マスク用

#define ctfInfoModeWithAmplitudeContrast    0x0f
#define ctfInfoModeWithMTF                  0x10
#define ctfInfoModeWithIlluminationAngle    0x20
#define ctfInfoModeWithEnergySpread         0x40
#define ctfInfoModeAbsoluteValue            0x100 
モード マスク部分 説明
ctfInfoModeWithAmplitudeContrast 0x0f コントラスト補正のモード
ctfInfoModeWithMTF 0x10 MTF積算のフラグ
ctfInfoModeWithIlluminationAngle 0x20 照射角度の考慮のフラグ
ctfInfoModeWithEnergySpread 0x40 エネルギー拡散の考慮のフラグ
ctfInfoModeAbsoluteValue 0x100 絶対値のフラグ


モード値の定義

コントラストモード

ctfInfo->modeにて使用(ctfInfoModeWithAmplitudeContrastでマスクした値に対応)

typedef enum ctfInfoMode {
	ctfInfoModePhaseCTFOnly   = 0,
	ctfInfoModePhaseAndAmpCTF = 1 
} ctfInfoMode;
モード 説明
ctfInfoModePhaseCTFOnly 0 位相コントラストだけ
ctfInfoModePhaseAndAmpCTF 1 強度コントラストを加える


envelope関数のモード

ctfInfo->MTFModeにて使用

typedef enum ctfInfoMTFMode {
	ctfInfoMTFModeSingleExp = 0,
	ctfInfoMTFModeSingleLorentzian = 1,
	ctfInfoMTFModeBoth      = 2,
	ctfInfoMTFModeLinear    = 3, 
	ctfInfoMTFModeBothSum   = 4,
	ctfInfoMTFModePolynomial = 5
} ctfInfoMTFMode;
モード 説明
ctfInfoMTFModeSingleExp 0 指数関数
ctfInfoMTFModeSingleLorentzian 1 ローレンツ関数
ctfInfoMTFModeBoth 2 指数関数×ローレンツ関数
ctfInfoMTFModeLinear 3 リニア
ctfInfoMTFModeBothSum 4 指数関数+ローレンツ関数
ctfInfoMTFModePolynomial 5 多項式


構造体

分子のエンベロープ関連で使用

typedef struct moleculrEnvelope {
	char* filename; 
	int   nR;
	float* R;
	float* Envelope;
	int    mode;	
} molecularEnvelope;

ctfInfo

CTFを計算する上で必要なパラメータになります。

電子顕微鏡や照射条件により決まるもの

kV [kV] 加速電圧(電子線の加速電圧、単位はkV)
Cc [mm] 色収差係数(単位はmm)
dE エネルギーの揺らぎ幅(色収差を使った包絡関数の計算に必要)
Cs [mm] 球面収差係数(単位はmm)
Ain [mrad] 照射半角(単位はmrad)(球面収差係数やデフォーカスによる包絡関数の計算に必要)(ファイル上ではAiとして表示)

デフォーカスにより決まるもの

defocus [A] デフォーカス量(単位はオングストーローム、正がアンダーフォーカス)
flagAstigmatism Integer 非点を考慮するかどうかのフラグ(0:考慮しない、1:考慮する)
defocus2D float[2] [A] デフォーカス量

試料(シグナル)によって決まるもの

I0 シグナル強度
Isignal シグナル強度
Inoise ノイズ強度
flagWhiteNoise Integer ホワイトノイズ(MTFにより影響を受ける成分)
WhiteNoise ノイズ強度
flagWhiteNoiseRasing Integer ホワイトノイズのMTFの落ちを考慮するかどうか
WhiteNoiseRasing MTFによりノイズが崩落する成分

解析の際に利用する量

flagWin Integer 窓関数をかけるかどうかのフラグ(0:かけない、1:かける)
CutLow A-1 窓関数の低周波側のエッジ
CutHigh A-1 窓関数の高周波側のエッジ


各APIの引数として使用する設定

typedef struct ctfInfo {
	float kV;      /* kV */
	float defocus; /* A : Underfocus is plus, while overfocus is minus*/
	float Cc;      /* mm */
	float dE; 
	float Cs;      /* mm */
	float Ain;     /* mrad : Illumination Angle */
	long  flagWin; /* Windowing */ 
	float CutLow;  /* Windowing: CutLow  A-1 */
	float CutHigh; /* Windowing: CutHigh A-1 */

	float I0;      /* Intensity */
	float Isignal; /* Intensity of signal */

	float ratioOfAmpToPhase; /* The ratio of amp to phase */

	float Inoise;  /* Intensity of noise : Isignal*/
	long  flagWhiteNoise;
	float WhiteNoise;  /* Affected by MTF(R) */

	long  flagWhiteNoiseRaising; 	
	float WhiteNoiseRaising; /* WhiteNoise Raising depending upon R */

	float Inoise2; /* Intensity of noise */
	long  flagWhiteNoise2;
	float WhiteNoise2; /* Not Affected by MTF(R)*/

	int   flagAstigmatism;
	float defocus2D[2];      /* A : Normally [0]: Max [1]: Min */
	float defocus0axis;      /* radian : angle of the defocus2D[0]-axis */

	long mode;
	
	long  flagMagnification;	
	float Magnification;

	/* MTF(R): Modulation Transfer Function */ 
	ctfInfoMTFMode MTFMode;
	float BofMTF;  /* Exponential: exp(-B R)   */
	float BofMTF2; /* Lorentzian : 1/(B*B+R*R) */	
	float WeightOfSecondTermForMTF; /* 0 <-> 1 */
	/*for PolynomialExpNoise*//*d = degree*/
	float BofMTFd2;
	float BofMTFd3;
	float BofMTFd4;
	float BofMTFd5;
	float BofMTFd6;

	/* Molecular Envelope: Scattering Factor */
	/* For Gaussian */
	float MolecEnv;                   /* A : */
	/* For Table */
	long  flagMolecEnvTable;
	molecularEnvelope MolecEnvTable;
	/* For Lorentzian */
	float flagElastic;
	float Elastic;
	float ElasticShift;
	float ElasticWidth;
	float ElasticRing;
	float ElasticRingPosition;
	float ElasticRingWidth;

	/* Stage Vibration */
	long  flagVibration;
	long  VibrationMode;
	float BofVibration;

	/* Aliasing and Sampling */
	long flagAliasing;
	float NyquistFrequency;
	long flagSampling; 

	/* Inelastic Signal */
	/* For Gaussian */
	long flagWithInElastic;
	float InElasticGaussian;
	/* For Table */
	long flagWithInElasticTable;
	molecularEnvelope InElasticEnvTable;	
	/* Lorentzian */	
	long flagInElastic;
	float InElastic;
	float InElasticShift;
	float InElasticWidth;
	float InElasticRing;
	float InElasticRingPosition;
	float InElasticRingWidth;
} ctfInfo;

API

スキャッタリング

シグナル(ctfSignalFunctionより)にノイズ(ctfNoiseFunctionより)を加えたときの値を返します。

extern float ctfScatteringFunction(ctfInfo* info, float R, long mode);

シグナル

シグナルを出力
(ctfFunction, ctfMolecularEnvelopeFunction, ctfMolecularEnvelopeInElasticFunction, ctfVibrationFunction, ctfMTFFunctionを使用)
info->flagAliasing=trueのとき: エイリアシングを加えます。(info->NyquistFrequencyによる)

extern float ctfSignalFunction(ctfInfo* info, float R, long mode);

上記のシグナルを強度で出力

extern float ctfSignalPowerFunction(ctfInfo* info, float R, long mode);
分子のエンベロープを算出

info->flagMolecEnvTable=trueのときはlmolecularEnvelopeDataGetを呼び出して、テーブル(info->MolecEnvTable)を元に算出

extern float ctfMolecularEnvelopeFunction(ctfInfo* info, float R, long mode);
extern float ctfMolecularEnvelopeInElasticFunction(ctfInfo* info, float R, long mode);

ノイズ

ホワイトノイズ(info->WhiteNoise)やMTF(ctfMTFFunctionより)などを掛け合わせて算出したノイズを出力
info->flagAliasing=trueのとき: エイリアシングを加えます。(info->NyquistFrequencyによる)

extern float ctfNoiseFunction(ctfInfo* info, float R, long mode);

上記のノイズを強度で出力

extern float ctfNoisePowerFunction(ctfInfo* info, float R, long mode);

ホワイトノイズにinfo->WhiteNoise2を使用して、ノイズを出力

extern float ctfNoise2Function(ctfInfo* info, float R, long mode);

上記のノイズを強度で出力

extern float ctfNoise2PowerFunction(ctfInfo* info, float R, long mode);

振動関数の算出

Rによる振動関数の値を算出
info->Magnification: Rの倍率

extern float ctfVibrationFunction(ctfInfo* info, float R, long mode);

info->flagVibration=trueかつinfo->VibrationMode=0のとき: 振動関数Env = exp(-B*B*R*R/2.0)を出力(それ以外の場合は1を出力)

CTFの算出

extern float ctfFunction(ctfInfo* info, float R, long mode);

RによるCTFの値を算出
電子線の波長: wavelengthOfElectronより算出
コントラスト: info->modeにより算出方法を設定

info->mode(0x0fでマスク) 説明
0 位相コントラストだけ
1 強度コントラストを加える


2Dの場合

X, YからRを求めて引数としてctfFunctionを呼び出す

extern float ctfFunction2D(ctfInfo* info, float X, float Y, long mode);

Envelope関数の算出

extern float ctfEnvelopFunction(ctfInfo* info, float R, long mode);

Rによるエンベロープ関数の値を算出
wavelengthOfElectronにより電子線の波長を取得
info->flagMagnification=1のとき: info->Magnification(0以外で)をRの倍率として掛ける

info->mode マスク部分 説明
ctfInfoModeWithMTF 0x10 MTFを積算(ctfMTFFunctionを呼び出す)
ctfInfoModeWithIlluminationAngle 0x20 照射角度(info->Ain)を考慮した値を積算
ctfInfoModeWithEnergySpread 0x40 エネルギー拡散を考慮した値を積算


MTFの算出

extern float ctfMTFFunction(ctfInfo* info, float R, long mode);

RによるMTFの値を算出
info->Magnification: 引数Rの倍率
info->flagSampling=1のとき: 標本化関数を積算(ctfFunctionSamplingを呼び出す: info->NyquistFrequencyを第2引数(ナイキスト)とする)

モード 説明 MTF算出時に使用するinfoのメンバ
ctfInfoMTFModeSingleExp 0 指数関数 BofMTF
ctfInfoMTFModeSingleLorentzian 1 ローレンツ関数 BofMTF2
ctfInfoMTFModeBoth 2 指数関数×ローレンツ関数 BofMTF, BofMTF2
ctfInfoMTFModeLinear 3 リニア BofMTF
ctfInfoMTFModeBothSum 4 指数関数+ローレンツ関数 BofMTF, BofMTF2, WeightOfSecondTermForMTF(2つの関数を加える割合)
ctfInfoMTFModePolynomial 5 多項式 BofMTF, BofMTFd2, BofMTFd3, BofMTFd4, BofMTFd5


標本化関数の算出

Rによる標本化関数の値を算出

extern float ctfFunctionSampling(float R, float Nyquist, long mode);

電子線の波長の取得

extern float wavelengthOfElectron(float E);

トーンリングからデフォーカスを推定

extern float defocusDeterminationFromThonRing(ctfInfo* info, float R, long n, long mode);

電子線の波長: wavelengthOfElectronより算出
コントラスト: info->modeにより算出方法を設定

info->mode(0x0fでマスク) 説明
0 位相コントラストだけ
1 強度コントラストを加える


CTF補正時の重みの算出

CTF補正で使用する重みを出力

extern float ctfWeightForCorrection(ctfInfo* info, float R, long mode);
mode 説明
0 1を返す(補正無し)
1 ctf/|ctf| (逆位相)
2 ctf (逆位相 x CTF補正)
3 1/ctf (0.1<|ctf| ) (CTF補正 / 逆位相)
4 ctf/(SQR(ctf)+SQR(NS)) phase-flipping + Winner Filtering
5 SQR(ctf) x ctf/|ctf| phase-flipping + ctf-Weighted
6 1/|ctf| (0.1<|ctf|) No phase-flipping + ctf-divided
7 |ctf|/(SQR(ctf)+SQR(NS)) No phase flipping + Winner Filtering


2Dの場合

X, YからRを求めて引数としてctfWeightForCorrectionを呼び出す

extern float ctfWeightForCorrection2D(ctfInfo* info, float X, float Y, long mode);

分子のエンベロープ

ファイル読み込み

extern void lmolecularEnvelopeFileRead(FILE* fpt, molecularEnvelope* mol, int mode);

ファイル書き出し

extern void lmolecularEnvelopeFileWrite(FILE* fpt, molecularEnvelope* mol, int mode);

リサンプリング

extern void lmolecularEnvelopeResampling(molecularEnvelope* dst, molecularEnvelope* src, float dR, float RMax, int mode);

srcにおけるRのエンベロープ値を取得

extern float lmolecularEnvelopeDataGet(molecularEnvelope* src, float R, int mode);

CTF情報

ファイル読み込み

extern void ctfInfoRead(FILE* fpt, ctfInfo* ctf, char* pre, int mode);

ファイル書き出し

extern void ctfInfoWrite(FILE* fpt, ctfInfo ctf, char* pre, int mode);

PVMインストール時のみ使用可

extern void ctfInfoSendByPVM(ctfInfo* info, int tid, long mode);
extern void ctfInfoRecieveByPVM(ctfInfo* info, int tid, long mode);
extern void  ctfFunctionPVMStart(ctfInfo* info, float R, int tid, long mode);
extern float ctfFunctionPVMEnd(ctfInfo* info, float R, int tid, long mode);
extern void  ctfFunctionPVMServer();

ヘルプ

extern void ctfWeightForCorrectionUsage(FILE* fpt);