-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatlab files.tex
66 lines (61 loc) · 9.02 KB
/
Matlab files.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
\section{Matlab files}
The program developed in this work is written in Matlab. All written Matlab files and a short description is given in the table below (\ref{longtable}). Note that the key files are written in bold text. The actual Matlab files are found in \path{F:\usb\mfiles\}. A simple description on how to use the program is given in the following paragraph.
The main file in this program is \textit{run\_program.m}. The first input is the full file name of the raw ultrasound data (e.g. \path{D:\Ultrasound image data\2014-04-28-10-23-41.rf}). The second input argument is an array of frame numbers from which the background should be computed (e.g. \verb|1:10|). The third and fourth argument are true/false statements. The decide if counting or background subtraction is performed, respectively. The fifth and sixth argument may be omitted, if the background file is based on frames within the video given in argument one. The sixth argument is the full file name, of a .mat where the correlation matrix for the previous video is stored (e.g.\path{C:\Phaseshiftcounting\2014-05-02-10-44-08\_PS\_count.mat}). This allow the counting of phase-shift bubble to continue from where the last video ended. The \textit{run\_program.m} perform motion correction, background subtraction and counting, in the respective order. The computation time will depend on the computer performance and the size of the raw ultrasound file, but between one and ten hours per file must be expected. Note that this script load and save several files to directories available on my computer. Directories and file names in the Matlab files may therefore be corrected for the program to work properly. the An example on how to run through a large set of ultrasound image data is given in \textit{batch\_process.m}
\begin{center}
\begin{longtable}{@{} p{3cm} p{3cm} p{2cm} p{4cm} @{}}
\caption{List of Matlab files. The most important files are written in bold text.}\label{longtable}\\
\toprule
Name & Input & Output & Function\\
\hline \endhead
\textbf{align\_image.m} & fixed image, moving image, transformation type, max iterations, initial transform, max step length) & & Align the moving image to the fixed image using MATLAB functions imregtform and imwarp. \\ \hline
all\_counted\_vs\_inserted.m & & & Perform non-linear fit of synthesized data \\ \hline
\textbf{batch\_process.m} & & & This script perform batch processing of the rf-data specified in \path{counting sheet.xlsx}. For all file names, the function run\_program is launched. \\ \hline
bubble\_count\_curve.m & & .mat files & Produce .mat files containing data later used for plotting of Number density as a function of time \\ \hline
bubble\_density.m & Number of bubbles, region of interest, Bmode parameters & number density & Compute number density from a given number of bubbles and a ROI. \\ \hline
bubble\_growth.m & & & Estimate bubble growth curve from existing single bubble tic curve \\ \hline
bubble\_tic.m & & .mat files & Produce .mat files with data later used to plot tic-curves \\ \hline
bubble\_zoom.m & frames, chosen pixels, show images(true/false) & maximum intensity & Zoom in on a region defined by the chosen pixels, and produce a smoothed close up video of these pixels. \\ \hline
\textbf{color\_code.m} & frame, contrast mask & RGB image & Color the contrast green in the .avi files. \\ \hline
compare\_manual\_and\_auto\_count.m & & Figures & Make histograms comparing manually and automatically counted data. \\ \hline
counted\_vs\_inserted.m & & & Compare results from the three different backgrounds\\ \hline
count\_max\_real\_data.m & & .txt file & Count the maximum counted number of phase-shift bubble for each video, and store in .txt file. \\ \hline
\textbf{count\_PS\_bubbles.m} & motion corrected file name, subtracted file name & .avi file and .mat file & Count the number of phase-shift bubbles and make the final .avi file. \\ \hline
\textbf{do\_subtraction.m} & frames & subtracted frames and background frame & Compute background and subtract the backgrounf from all frames. \\ \hline
draw\_roi.m & frame & ROI & Allow the user to draw a ROI on a frame. \\ \hline
evalc2decimal.m & string & decimal number & Convert a string to a decimal number \\ \hline
frame\_counter.m & Full file name of raw US data & Total number of frames in file & Count the number ov video frames in a raw file (.rf/.iq) \\ \hline
\textbf{get\_background.m} & Frames & background & Compute background by maximum projection of the given frames \\ \hline
get\_correlation.m & frame A, frame B, & correlation & Compute correlation between two frames \\ \hline
get\_growth\_intensity.m & max intensity, start frame, length & intensity array & Multiply the intensity obtained with growth\_fun.m to obtain correct intensity function \\ \hline
get\_param.m & file name raw US data & image parameter & Obtain image parameters \\ \hline
\textbf{get\_RF\_from\_IQ.m} & Full file name of raw US data, frame number & RF data, parameters & Obtain RF-data from IQ data. \\ \hline
get\_tic.m & file\_reference, t & intensity array & Compute time intensity curve for a file given by the file reference. t(seconds) is a time array. \\ \hline
growth\_fun.m & frame numbers & growth function & Calculate the bubble growth function for the given frame numbers \\ \hline
hms2sec.m & d1,h1, m1, s1, d2, h2, m2, s2 & seconds & Compute seconds elapsed between two timestamps. \\ \hline
im\_sub.m & frame A, frame B, type & Difference frame & Subtract frame B from A, and set all values less than zero equal to zero. \\ \hline
insert\_bubble.m & Intensity, x-position, y-position, frame & frame with bubble & Insert a synthesized bubble at a given position and and intensity given in the given frame \\ \hline
investigate\_pixels.m & & Figures & Plot the intensity as a function of frame for a given pixel. \\ \hline
log\_compress\_2.m & array, 'compress/decompress' & array & Approximation to log-compression(envelope) in log\_compress.m Can compress or decompress. \\ \hline
log\_compress.m & RF-data & compressed data & Perform hilbert transform and log compression on RF- data \\ \hline
make\_intensity\_distribution.m & & probability object & Compute probability density function for the intensity distribution. \\ \hline
make\_ref\_frame.m & Full filename, frame indexes, extension(rf/iq) & reference frame and parameters & Make reference frame for motion correction. \\ \hline
mat2avi.m & filename & .avi file & Contruct .avi file from .mat file \\ \hline
\textbf{motion\_correction.m} & Filename(mat file) & motion corrected .mat file & Compute motion corrected .mat file from a .mat file \\ \hline
mse.m & frame A, frame B & Mean square error & Compute mean square error between two frames. \\ \hline
plot\_bubble\_count\_curve.m & & Figures & Plot bubble count curves from .mat files produced with bubble\_count\_curve.m \\ \hline
plot\_bubble\_tic.m & & Figures & Plot tic curves from the .mat files produced with bubble\_tic.m \\ \hline
plot\_tic\_curves.m & Counted .mat file name, subtracted .mat file name & time array, intensity curves & Calculate intensity curves for single bubbles and show close-up video of bubbles. \\ \hline
point\_spread\_fun.m & & & Calculate the PSF from an identified bubble. \\ \hline
progressbar.m & ratio & Figure & Show progress bar. Public available script. \\ \hline
psf.m & & & return the PSF \\ \hline
random\_intensity.m & intensity distribution & intensity & Draw a random intensity from the intensity distribution. \\ \hline
random\_position.m & Roi, N & x and y coordinate & Draw N random positions within ROI. \\ \hline
ReadRF.m & full filename, mode name, and frame number & RF data, parameters & Read in RF data. Written by A.Healey. \\ \hline
\textbf{RF2mat.m} & Full filename & .mat file & Convert raw US data to .mat file. \\ \hline
\textbf{run\_program.m} & File name raw US data, background frame index, count(true/false), bg\_subtraction(true/false), background file name, correlation array file name. & .avi file and . Mat file & Perform all processing from raw US data to counted .avi file and .mat file. If count or background\_subtraction is false, the program will not perform these tasks. Background file name must be included if the background is supposed to be made from another file. Correlation array file name is the name of the previous video sequence. \\ \hline
\textbf{subtraction\_fun.m} & File name motion corrected .mat file, indexes for background & .mat file(subtracted data) & Create background file, and subtract the background from all frames. Save subtracted frames as .mat file \\ \hline
time\_array\_from\_ time\_stamps.m & time stamp 1, time stamp 2. & time array(seconds) & Make time array from two time stamps \\ \hline
VsiBModeIQ.m & Full file name, mode name, and frame number & IQ data and parameters & Compute IQ data from RF-data. Written by A. Needles, J. Mehi. Copyright VisualSonics 1999-2010 \\
\end{longtable}
\end{center}
\clearpage