📄 pifft.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of pifft</title> <meta name="keywords" content="pifft"> <meta name="description" content="PIFFT - Homodyne reconstruciton of partial MRI k-space (Spatial Frequency) data"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">mri_toolbox</a> > pifft.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for mri_toolbox <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>pifft</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>PIFFT - Homodyne reconstruciton of partial MRI k-space (Spatial Frequency) data</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function [m] = pifft(pksp) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> PIFFT - Homodyne reconstruciton of partial MRI k-space (Spatial Frequency) data
IMG = PIFFT(KSP)
The input KSP is assumed to be a rectangular matrix with the number of rows
equaling the number of phase encodes (lines) of the image's k-space. The
first rows of the matrix should be the highest frequency phase encodes
acquired so that the center of k-space is near the bottom of the matrix.
The image is reconstructed for the next highest power of 2 greater than the
number of phase encodes in the partial k-space data set.
Example:
load mri
img = double( squeeze(D(:,:,1,16)) );
ksp = fftshift( fft2( img ) );
pksp = ksp(1:68,:);
m=pifft(pksp);
figure;
subplot(1,3,1); imagesc(img); axis image; title('128 of 128 of k-space lines');
subplot(1,3,2); imagesc(m); axis image; title('68 of 128 of k-space lines');
subplot(1,3,3); imagesc(abs(img-m)); axis image; title('abs. difference');
colormap(gray);
Reference:
Noll DC, Nishimura DG, Macovski A. Homodyne Detection in Magnetic
Resonance Imaging. IEEE Trans. on Medical Imaging 1991; 10(2):154-163</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [m] = pifft(pksp)</a>0002 0003 <span class="comment">% PIFFT - Homodyne reconstruciton of partial MRI k-space (Spatial Frequency) data</span>0004 <span class="comment">%</span>0005 <span class="comment">% IMG = PIFFT(KSP)</span>0006 <span class="comment">% The input KSP is assumed to be a rectangular matrix with the number of rows</span>0007 <span class="comment">% equaling the number of phase encodes (lines) of the image's k-space. The</span>0008 <span class="comment">% first rows of the matrix should be the highest frequency phase encodes</span>0009 <span class="comment">% acquired so that the center of k-space is near the bottom of the matrix.</span>0010 <span class="comment">% The image is reconstructed for the next highest power of 2 greater than the</span>0011 <span class="comment">% number of phase encodes in the partial k-space data set.</span>0012 <span class="comment">%</span>0013 <span class="comment">% Example:</span>0014 <span class="comment">%</span>0015 <span class="comment">% load mri</span>0016 <span class="comment">% img = double( squeeze(D(:,:,1,16)) );</span>0017 <span class="comment">% ksp = fftshift( fft2( img ) );</span>0018 <span class="comment">% pksp = ksp(1:68,:);</span>0019 <span class="comment">% m=pifft(pksp);</span>0020 <span class="comment">%</span>0021 <span class="comment">% figure;</span>0022 <span class="comment">% subplot(1,3,1); imagesc(img); axis image; title('128 of 128 of k-space lines');</span>0023 <span class="comment">% subplot(1,3,2); imagesc(m); axis image; title('68 of 128 of k-space lines');</span>0024 <span class="comment">% subplot(1,3,3); imagesc(abs(img-m)); axis image; title('abs. difference');</span>0025 <span class="comment">% colormap(gray);</span>0026 <span class="comment">%</span>0027 <span class="comment">% Reference:</span>0028 <span class="comment">%</span>0029 <span class="comment">% Noll DC, Nishimura DG, Macovski A. Homodyne Detection in Magnetic</span>0030 <span class="comment">% Resonance Imaging. IEEE Trans. on Medical Imaging 1991; 10(2):154-163</span>0031 <span class="comment">%</span>0032 <span class="comment">%</span>0033 0034 <span class="comment">%</span>0035 <span class="comment">% Written by Edward Brian Welch (edwardbrianwelch@yahoo.com)</span>0036 <span class="comment">% MRI Research Lab, Mayo Graduate School, November 2001</span>0037 <span class="comment">%</span>0038 0039 <span class="comment">% ERROR CHECKING</span>0040 <span class="keyword">if</span> ndims(pksp)~=2 | ~isnumeric(pksp),0041 error(<span class="string">'PFFT operates on two-dimensional numerical data'</span>);0042 <span class="keyword">end</span>0043 0044 <span class="comment">% Convert data into hybrid space by inverse FFT along FE dir.</span>0045 <span class="comment">% for better numerical accuracy.</span>0046 pksp = ifft(pksp,[],2);0047 0048 <span class="comment">% Frequency Encode direction is assumed to be the longer direction</span>0049 [Npp Nf] = size(pksp);0050 0051 <span class="comment">% Number of phase encodes in the full k-space</span>0052 Np = 2^nextpow2(Npp+1);0053 0054 <span class="comment">% Number of high frequency phase encodes</span>0055 NH = Np-Npp;0056 0057 <span class="comment">% NUmber of low frequency phase encodes</span>0058 NL = Npp - NH;0059 0060 <span class="comment">% Row indices of high and low frequency lines</span>0061 HFind = 1:NH;0062 LFind = (NH+1):(NH+NL);0063 0064 <span class="comment">% Create weighting window</span>0065 <span class="comment">%</span>0066 <span class="comment">% It multiplies all un-partnered high frequency lines by 2.0</span>0067 <span class="comment">% Low frequency lines are multiplied by a ramp that approaches</span>0068 <span class="comment">% zero at the zero-padded edge of k-space. The weighting</span>0069 <span class="comment">% factors of two partnered low frequency lines should have a</span>0070 <span class="comment">% sum of 2.0</span>0071 w = zeros(Np,1);0072 w(HFind) = 2;0073 rstep = 2/(NL+1);0074 w(LFind) = [(2-rstep):-rstep:rstep];0075 0076 <span class="comment">% Create weighted partial k-space</span>0077 HFksp = zeros(Np,Nf);0078 HFksp(1:Npp,:)=pksp;0079 HFksp = HFksp.*repmat(w,1,Nf);0080 0081 <span class="comment">% Create Low Frequency k-space</span>0082 LFksp = zeros(Np,Nf);0083 LFksp(LFind,:) = pksp(LFind,:);0084 0085 <span class="comment">% Low frequency image</span>0086 Rc = ifft(LFksp,[],1);0087 0088 <span class="comment">% Unsynchronous image</span>0089 Ic = ifft(HFksp,[],1);0090 0091 <span class="comment">% Synchronous image</span>0092 Is = Ic.*exp(-i*angle(Rc));0093 0094 <span class="comment">% Demodulated image</span>0095 m = real(Is);0096 0097 <span class="keyword">return</span></pre></div><hr><address>Generated on Fri 21-May-2004 12:38:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -