It is a function, say $$I: \Omega \subset \mathbb{R}^3 \longrightarrow \mathbb{R}$$ sampled over an equispaced grid of points $X=\left\{ x_{1},\dots x_{n} \right\}$ s.t. $x_i \in \Omega$
A segmentation or VOI is an arbitrary subset $\Gamma \subseteq \Omega$ and its mask a function
$$\gamma(x) = \left\{ \begin{array}{c c} 1 & x\in \Gamma \\ 0 & x\notin \Gamma \end{array} \right.$$# let's have a look at the histogram!
I=nib.load("t1w.nii.gz").get_data()
figure(1)
a=hist(I[(I>10)&(I<2500)],100)
f, (ax1, ax2, ax3) = plt.subplots(1, 3,figsize=(18,18))
J1=np.zeros(I.shape); J2=np.zeros(I.shape)
thresh1=(I>1200)&(I<2000)
J1[thresh1]=I[thresh1]
thresh2=(I>500)&(I<1200)
J2[thresh2]=I[thresh2]
ax1.imshow(rot90(I[80,:,:]))
ax2.imshow(rot90(J1[80,:,:]))
ax3.imshow(rot90(J2[80,:,:]))
<matplotlib.image.AxesImage at 0x133a64b50>
/usr/local/fsl/bin/flirt -in input.nii.gz -ref ref.nii.gz -out output.nii.gz -omat output.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12 -interp trilinear
bash $ANTSPATH/antsRegistrationSyN.sh -d 3 -f reference.nii.gz -m input.nii.gz -t a -o output
/usr/local/fsl/bin/flirt -applyxfm -in input2.nii.gz -ref ref.nii.gz -out output2.nii.gz -init output.mat -interp trilinear
$ANTSPATH/antsApplyTransforms -d 3 -i input2.nii.gz -r ref.nii.gz -o output_lesions.nii.gz -n NearestNeighbor -t output.mat
Say that the image I is represented by a function $$I: \Omega \subset \mathbb{R}^3 \longrightarrow \mathbb{R}$$ and the reference image is $R$ we look for a function $$f: \mathbb{R}^3 \longrightarrow \mathbb{R}^3 $$
Such that $$\arg\min_{f} \mathcal{D} \left[ I(f(x)), R(x) \right]$$ where $\mathcal{D}\left[ \cdot , \cdot \right]$ is an appropriate distance (or pseudo-distance).
Let us consider linear tranformation $$ f(x) = A\cdot x +b$$
DOF:
The distance function $\mathcal{D}\left[ \cdot , \cdot \right]$ plays an important role in registration procedure
Some examples:
SSD, sum squared differences $$SSD \left[ A , B \right]=1/2 \int_{\Omega}\left(A(x)-B(x)\right)^2 \; dx$$
NCC, normalized cross-correlation $$NCC \left[ A , B \right]=1- \frac{\left< A,B\right>^2}{||A||_2 ||B||_2}$$ with the scalar product $$\left< A,B\right>=\int_{\Omega} A(x)B(x) \; dx$$
NGF, normalized gradient-field
$$NGF \left[ A , B \right]= \int_{\Omega} 1 - \left< g_{\eta}(A),g_{\eta}(B)\right>^2 \; dx$$were the gradient-field is defined as $$g_{\eta}(A(x)) = {\bigtriangledown A(x) \over \sqrt{||\bigtriangledown A(x)||^2 + \eta}}$$
KLD, Kullback_Leibner Divergence
$$KLD \left[ A , B \right]= \int_{\Omega} \ln \left( \frac{A(x)}{B(x)} \right)A(x) \; dx$$J Modersitzki, Numerical Methods for Image Registration (2004) Oxford University Press
Jan Modersitzki, FAIR: Flexible Algorithms for Image Registration (2009) SIAM
G Dougherty, Digital Image Processing for Medical Applications (2009) Cambridge University Press
JV Hajnal, D Hill and DJ Hawkes, Medical Image Registration (2001) CRC Press
A Passarini, Medical Image Registration for Motion Detection and Correction, thesis, 2015
A brain image $$P(x): \Omega \subseteq \mathbb{R}^3 \longrightarrow \mathbb{R}$$ is segmented in three binary masks $$P_g+P_w+P_c=1$$ representing GM, WM, CSF respectively.
Let us define the gray-white matter interface $$GWI=P_g \cup dil_1(P_w)$$ and the brain tissue mask as $$P_{wg}=P_w \cup P_g$$
We look for the diffeomorphism $$\phi : \Omega \times [0,1] \longrightarrow \Omega $$ such that:
So we look for a diffeomorphism $\phi$ which minimizes $$E(\phi(x,1)) = \int_{0}^{1} ||v(x,t)||^2 \; dt \;\; + \;\; \left|\left|P_w(\phi(x,1)) - P_{wg} (x) \right| \right|^2$$ subject to: $$\phi(x,t)=x+\int_{0}^{t} v(\phi(x,t),t) \; dt$$ $$T(x)=\left|\phi(x,1)-\phi(x,0)\right|<\tau \;\; \forall x\in GWI$$
Let us suppose to have a time-series PET data obtained using $^{18}$F-dg tracer $$P(x) : \Omega \times [0,T_{e}] \longrightarrow \mathbb{R}$$ Sampled over a discerete set of points $X$ and times $T$. If we want to estimate the absolute rate of absorption MRGlu, we need a model of the tracer kinetic.
Were C(t) is the mean of the activity inside a given VOI.
This is a ODE compartment model $$\left\lbrace \begin{array}{c c c} \dot{C_p} & = &-k_1 C_p + k_2 C_f + u& \\ \dot{C_f} & = &-k_2 C_f -k_3 C_f& \\ \dot{C_b} & = &+k_3 C_f&\\ \end{array}\right. $$ Once fitted, we can compute $K=\frac{k_1 k_3}{k_2 + k_3}$ and find the glucose absorption rate as $$MRGlu = \frac{PG}{LC} K$$