-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMCImacrocourse.tex
276 lines (231 loc) · 7.86 KB
/
CMCImacrocourse.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
% Kota Miura (miura at embl.de)
% Macro Course Textbook
\documentclass[11pt,a4paper,oneside]{report}
% Palatino for rm and math | Helvetica for ss | Courier for tt
\usepackage{mathpazo} % math & rm
\linespread{1.05} % Palatino needs more leading (space between lines)
\usepackage[scaled]{helvet} % ss
\usepackage{courier} % tt
%\usepackage{inconsolata} %tt
%\usepackage[scaled]{ulgothic} %tt no style fi
%\renewcommand*\ttdefault{cmvtt} %tt
%\renewcommand*\ttdefault{lmvtt} %tt OK
\normalfont
\usepackage[T1]{fontenc}
\usepackage[footnotesize]{caption}
\usepackage{subfig}
\linespread{1.05} % Palatino needs more leading (space between lines)
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue}
%\usepackage{url} % this will just show url in different font
\usepackage[pdftex]{graphicx}
\usepackage{color}
\definecolor{gray09}{rgb}{0.9,0.9,0.9} %background for codes
\definecolor{red}{rgb}{1,0,0}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{lightblue}{rgb}{0,0.8,1}
%for header
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
%\pagestyle{fancy}
\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}{}}
\lhead{\fancyplain{}{\textit{CMCI ImageJ Macro Course}}}
\chead{}
\rhead{\fancyplain{}{\textit{\rightmark}}}
\lfoot{}
\cfoot{\fancyplain{}{\thepage}}
\rfoot{}
% space between paragraphs
\parskip 7.2pt
% indent
\setlength{\parindent}{0in} % avoids indent at the beginning of paragraph
%%\usepackage{lipsum}
%\newenvironment{indentexercise}[1]%
%{\begin{list}{}%
% {\setlength{\leftmargin}{#1}}%
% \item[]%
%}
%{\end{list}}
\newenvironment{indentexercise}[1]%
{{\setlength{\leftmargin}{2em}}%
\textbf{Exercise \thesubsection-#1}%
\begin{list}{}%
\item%
}
{\end{list}}
%indenting for case with Fiji
\newenvironment{indentFiji}%
{\begin{list}{}%
{\setlength{\leftmargin}{1em}}%
\item[]%
}
{\end{list}}
%indenting for case with Command Definition
\newenvironment{indentCom}%
{\begin{list}{}%
{\setlength{\leftmargin}{1em}}%
\item[]%
}
{\end{list}}
%\colorbox{red}
%command for menu tree
\newcommand{\ijmenu}[1]{\texttt{\small#1}}
%command for inline code
\newcommand{\ilcom}[1]{\texttt{\small#1}}
%quick command for making space
\newcommand{\tab}{\hspace*{3em}}
% packge for codes
% --- source code matters ---
\usepackage{listings}
%\usepackage{listingsutf8}
\lstset{ %
%language=Octave, % choose the language of the code
%basicstyle=\footnotesize, % the size of the fonts that are used for the code
basicstyle=\small\ttfamily, % same as above, but use typewriter
numbers=left, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it's 1 each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{gray09}, % choose the background color. You must add \usepackage{color}
keywordstyle=\color{blue}, %added
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
%frame=single, % adds a frame around the code
%frame=trBL,
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
%breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
escapeinside={\%*}{*)}, % if you want to add a comment within your code
morekeywords={*,...}, % if you want to add more keywords to the set
morecomment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]",
%aboveskip={7.2pt} %supposed to be the space above llisting but dows not work.
%belowskip={7.2pt}
}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%using eps
\usepackage{epstopdf}
%using pdflatex-makefile revision
\input{revision}
% title page matters
% http://sunsite.bilkent.edu.tr/pub/tex/ctan/info/latex-samples/titlepages.pdf
\newcommand*{\titleTH}{\begingroup% T&H Typography
\raggedleft
\HRule\\
\vspace*{\baselineskip}
{\Large Kota Miura}\\[0.167\textheight]
{\bfseries EMBL-CMCI course II}\\[\baselineskip]
{\textcolor{Medium}{\Huge Macro Programming in ImageJ}}\\[\baselineskip]
{\small ver 2.1.1}\\
{\small \Revision}\par
\vfill
%{\Large Centre for Molecular \& Cellular Imaging\\EMBL Heidelberg\\\plogo}\par
{\Large Centre for Molecular \& Cellular Imaging\\EMBL Heidelberg}\par
\includegraphics[width=0.15\textwidth]{fig/rgb_logo_2006_win.eps}
\includegraphics[width=0.07\textwidth]{fig/Icon30pedge.jpg}\\[1cm]
\vspace*{3\baselineskip}
\HRule\\
\endgroup}
\definecolor{Dark}{gray}{.2}
\definecolor{Medium}{gray}{.6}
\definecolor{Light}{gray}{.8}
\definecolor{shadecolor}{rgb}{0.9, 0.9, 1}
%making 1.5 spaced lines
\usepackage{setspace}
\onehalfspacing
% background shading
\usepackage{framed}
\usepackage{pdfsync}
%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\title{Image Processing and Analysis Course II\\
Macro Programming in ImageJ}
\author{Kota Miura\\
\\
Centre for Molecular and Cellular Imaging,\\
EMBL Heidelberg,\\
Germany\\
\\
\texttt{[email protected]}
}
\date{\today}
%\maketitle
\pagestyle{empty}
\titleTH
\clearpage
\pagestyle{fancyplain}
\begin{abstract}
\HRule
\\
\\
\textbf{Aim: Students acquire ImageJ macro programming technique
to ease their work loads with image processing / analysis.}
\\
\\
%need to fix greek beta
Note: This textbook was written using Fiji (ImageJ 1.44e).
When you want to distribute, please ask Kota as this textbook is progressively edited.
\\
Compiled on \today \\
$\copyright$ 2006 - 2015, Kota Miura (http://cmci.embl.de)
\\
\HRule
\end{abstract}
\begingroup
\hypersetup{linkcolor=black}
\tableofcontents
\endgroup
\clearpage
\setcounter{chapter}{2}
%\include{CMCImacrocourse_contents}
\section{Aim: Why do we write ImageJ macro?}
\input{sections/macroAims.tex}
\section{Introduction}
\input{sections/macroIntro.tex}
\section{Basics}
\label{sec:ImageJMacroBasics}
\input{sections/basics/macroBasics_HelloWorld.tex}
\input{sections/basics/macroBasics_VarStr.tex}
\input{sections/basics/macroBasics_ParameterInput.tex}
\input{sections/basics/macroBasics_MacroRecording.tex}
\input{sections/basics/macroBasics_BatchProcess.tex}
\section{Conditions and Loops}
\input{sections/macroConditionsLoops}
\input{sections/conditionsloops/macroConditionsApplication}
\input{sections/conditionsloops/macroWhileApplication}
\section{Advanced Topics}
\label{sec:advancedTopics}
\input{sections/adv/macroAdv_intro}
\input{sections/adv/macroAdv_UserFunctions}
\input{sections/adv/macroAdv_UserFunctions_example}
\input{sections/adv/macroAdv_MultiParameterDialog}
\input{sections/adv/macroAdv_GlobalVariables}
\input{sections/adv/macroAdv_StringArrays}
\input{sections/adv/macroAdv_NumArrays}
\input{sections/adv/macroAdv_ArrayFunctions}
\input{sections/adv/macroAdv_ArrayApplications}
\input{sections/adv/macroAdv_ArrayApplications_SegmentedROI}
\section{File I/O}
\input{sections/io/macroIO_intro}
\input{sections/io/macroIO_resultsSaving}
\input{sections/io/macroIO_batchProcess}
\input{sections/io/macroIO_WorkingWithStrings}
\section{Secondary Measurement}
\input{sections/secondaryMeasurements}
\section{Using Javascript}
\input{sections/javascript}
\section{Actual Macro programming}
\input{sections/ActualProgramming}
\section{Homework}
\input{sections/homeworks}
\section{Appendix}
\input{sections/adv/appendix_arrayReturnFunctions}
\end{document}