1. Input the phase T00, T10, T90 are the checking phases. All SliceIM(i,j) is the SliceIM in the phase i and in the index j. And SliceIM must contain only the left and right lung partitions. Slices with valid lung segmentation are selected for modeling. |
2. Registration |
a) Step through all possible phases = T10, .. T90 |
b) Step through all possible slices =1, .. number of slice in the considered phase |
c) Calculate LBPErrorRate(i,j,phase) = CalcLBPErrorRate(Slice(slice,phase), Slice(slice-5:slice+5,T00) |
d) Calculate EntropyErrorRate(i,j,phase) = CalcEntropyErrorRate(Slice(slice,phase), Slice(slice-5:slice+5,T00) |
e) Find the index of slice with minimum LBP and Entropy Error Rate RegisterIdx = Index(LBPErrorRate(i,j,m), 2, ‘smallest’) |
UNION Index(EntropyErrorRate(i,j,m), 2, ‘smallest’) |
f) Store EntropyErrorRate and LBPErrorRate LBPErrorRateRegistrationResult(slice,phase) = LBPErrorRate(i, RegisterIdx, phase) and EntropyErrorRateRegistrationResult(slice,phase) = EntropyErrorRate(i, RegisterIdx, phase) |
3. Signal Modeling |
a) Step through all possible phases = T10, .. T90 |
b) Calculate the standard deviation of LBP Error Rate and Entropy Error Rate for each phase from slices STD_LBPErrorRate(phase) = StandardDeviation(LBPErrorRateRegistrationResult(:,phase)) and STD_EntropyErrorRate(phase) = StandardDeviation(EntropyErrorRateRegistrationResult(:,phase)) |
c) Take the sum of error rates on each phase in registration to phase T00 ErrorRate(phase) = STD_LBPErrorRate(phase) + STD_EntropyErrorRate(phase) |
d) Signal Model by plotting the variation of error rates from phases T10, …, T90 |
e) Evaluation If the signal increases, it represents the inhalation process and If the signal decreases, it represents the exhalation process |
4. End |
5. Result in Respiratory signal |
Appendix |
StandardDeviation method |
1. Calculate Mean |
FOR i =0 to N |
sum = sum + X[i] |
next i |
ENDLOOP |
M = sum / N // Divides the sum by the total number, N, to get Mean |
2. Calculate Variance |
FOR j =0 to N |
sumOfSquares = sumOfSquares + ((X[j] - M)^2) // etc... |
next j |
ENDLOOP |
3. Standard Deviation |
stdDev = sqrt(sumOfSquares / (N -1)) |