This file is indexed.

/usr/share/doc/nip2/html/nipguidese13.html is in nip2 7.38.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  
  "http://www.w3.org/TR/html4/loose.dtd">  
<html > 
<head><title>Command-line interface</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)"> 
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)"> 
<!-- 3,html --> 
<meta name="src" content="nipguide.tex"> 
<meta name="date" content="2014-01-18 12:46:00"> 
<link rel="stylesheet" type="text/css" href="nipguide.css"> 
</head><body 
>
  <!--l. 517--><div class="crosslinks"><p class="noindent">[<a 
href="nipguidese12.html" >prev</a>] [<a 
href="nipguidese12.html#tailnipguidese12.html" >prev-tail</a>] [<a 
href="#tailnipguidese13.html">tail</a>] [<a 
href="nipguidech4.html#nipguidese13.html" >up</a>] </p></div>
  <h3 class="sectionHead"><span class="titlemark">4.5    </span> <a 
 id="x21-390004.5"></a>Command-line interface</h3>
<!--l. 518--><p class="noindent" ><a name="nip_label_sec:cmdline"></a>
<!--l. 520--><p class="indent" >  You can use <span 
class="phvr7t-x-x-80">nip2 </span>from the command-line as well as from
the GUI. This can be handy for automation: you can build a
workspace and then run it over a whole set of images, or use
<span 
class="phvr7t-x-x-80">nip2 </span>as part of a larger system. We&#8217;ve make websites which
use <span 
class="phvr7t-x-x-80">nip2 </span>as the back-end.
<!--l. 525--><p class="indent" >  In command-line mode <span 
class="phvr7t-x-x-80">nip2 </span>runs without a GUI of any
sort, it doesn&#8217;t even need a window system to be installed
on the machine. This makes it possible to use it in a server
or batch context.
<!--l. 529--><p class="indent" >  These notes are for the Unix command-line, but they
should work for Windows as well.
<!--l. 532--><p class="indent" >  <span 
class="phvr7t-x-x-80">nip2 </span>has three main modes of operation from the
command-line:
    <dl class="description"><dt class="description">
<span 
class="phvb7t-x-x-80">nip2 </span><span 
class="ptmbi7t-">filename1 </span><span 
class="ptmb7t-">&hellip;</span> </dt><dd 
class="description">Start  <span 
class="phvr7t-x-x-80">nip2  </span>in  GUI  mode,  loading  the
    command-line  arguments  as  files.  Filenames  can
    be images, workspaces, matricies, toolkits, and so
    on.
    </dd><dt class="description">
<span 
class="phvb7t-x-x-80">nip2 -e </span><span 
class="ptmbi7t-">expression arg1 </span><span 
class="ptmb7t-">&hellip;</span> </dt><dd 
class="description">Start in no-GUI mode, print
    the value of <span 
class="ptmri7t-">expression</span>. The list <span 
class="phvr7t-x-x-80">argv  </span>is set to be
    <span class="obeylines-h"><span class="verb"><span 
class="pcrr7t-">["filename","arg1",..]</span></span></span>.
    </dd><dt class="description">
<span 
class="phvb7t-x-x-80">nip2 -s </span><span 
class="ptmbi7t-">filename arg1 </span><span 
class="ptmb7t-">&hellip;</span> </dt><dd 
class="description">Start  in  no-GUI  mode,  read
    in   <span 
class="ptmri7t-">filename   </span>as   a   set   of   definitions,   print   the
    value  of  symbol  <span 
class="phvr7t-x-x-80">main</span>.  The  list  <span 
class="phvr7t-x-x-80">argv  </span>is  set  to  be
    <span class="obeylines-h"><span class="verb"><span 
class="pcrr7t-">["filename","arg1",..]</span></span></span>.
    </dd></dl>
<!--l. 551--><p class="indent" >  You can use the <span 
class="phvr7t-x-x-80">-o </span>option to send output somewhere
other than the screen. If these modes don&#8217;t do quite
what you need, you can get finer control of how <span 
class="phvr7t-x-x-80">nip2</span>
behaves with a set of other options: see the man page for
details.
                                             <!--l. 556--><p class="noindent" >
      <h4 class="subsectionHead"><span class="titlemark">4.5.1    </span> <a 
 id="x21-400004.5.1"></a>Using expression mode</h4>
  <!--l. 558--><p class="noindent" >The <span 
class="phvr7t-x-x-80">-e </span>option is very easy to use. For example:
                                                                                       

                                                                                       
  <div class="verbatim" id="verbatim-11">
nip2&#x00A0;-e&#x00A0;"2&#x00A0;+&#x00A0;2"
</div>
<!--l. 562--><p class="nopar" >
<!--l. 564--><p class="noindent" >Prints 4 to stdout.
                                                 <div class="verbatim" id="verbatim-12">
  nip2&#x00A0;-e&#x00A0;"99&#x00A0;+&#x00A0;Image_file&#x00A0;argv?1"&#x00A0;-o&#x00A0;result.png&#x00A0;fred.jpg 
</div>
<!--l. 569--><p class="nopar" >
<!--l. 571--><p class="noindent" >Loads argv1 (<span 
class="phvr7t-x-x-80">fred.jpg</span>), adds 99, writes the result to <span 
class="phvr7t-x-x-80">result.png</span>.
                                                                                       

                                                                                       
  <div class="verbatim" id="verbatim-13">
nip2&#x00A0;-e&#x00A0;"Matrix&#x00A0;[[1,2],[4,5]]&#x00A0;&#x22C6;&#x22C6;&#x00A0;-1"&#x00A0;-o&#x00A0;poop.mat
</div>
<!--l. 576--><p class="nopar" >
<!--l. 578--><p class="noindent" >Invert the 2x2 matrix and write the result to <span 
class="phvr7t-x-x-80">poop.mat</span>.
<!--l. 581--><p class="indent" >  If the result of the expression is a list, each item is printed
on a new line. For example:
                                                 <div class="verbatim" id="verbatim-14">
  nip2&#x00A0;-e&#x00A0;"[1..5]" 
</div>
<!--l. 586--><p class="nopar" >
<!--l. 588--><p class="noindent" >Will print the numbers 1 to 5, each on a new line.
<!--l. 591--><p class="indent" >    If you have a list result and you are using <span 
class="phvr7t-x-x-80">-o </span>to direct the
output to a file, the filename will be incremented each time
you write. For example:
                                                                                       

                                                                                       
  <div class="verbatim" id="verbatim-15">
nip2&#x00A0;-e&#x00A0;"map&#x00A0;(add&#x00A0;(Image_file&#x00A0;argv?1))&#x00A0;[10,&#x00A0;20&#x00A0;..&#x00A0;50]"&#x00A0;-o&#x00A0;result1.png&#x00A0;fred.jpg
</div>
<!--l. 596--><p class="nopar" >
<!--l. 598--><p class="noindent" >Will load <span 
class="phvr7t-x-x-80">fred.jpg</span>, add 10, 20, 30, 40 and 50, then save those
images to <span 
class="phvr7t-x-x-80">result1.png </span>to <span 
class="phvr7t-x-x-80">result5.png</span>.
<!--l. 602--><p class="noindent" >
  <h4 class="subsectionHead"><span class="titlemark">4.5.2    </span> <a 
 id="x21-410004.5.2"></a>Using script mode</h4>
<!--l. 604--><p class="noindent" >With the <span 
class="phvr7t-x-x-80">-s </span>option you can use <span 
class="phvr7t-x-x-80">nip2 </span>as a Unix script
interpreter.
<!--l. 606--><p class="indent" >  Create a file in your favourite text editor called <span 
class="phvr7t-x-x-80">brighten</span>
containing:
                                                 <div class="verbatim" id="verbatim-16">
  #!/usr/bin/nip2&#x00A0;-s
 &#x00A0;<br />
 &#x00A0;<br />main
 &#x00A0;<br />&#x00A0;&#x00A0;=&#x00A0;clip2fmt&#x00A0;infile.format&#x00A0;(infile&#x00A0;&#x22C6;&#x00A0;scale),&#x00A0;argc&#x00A0;==&#x00A0;3
 &#x00A0;<br />&#x00A0;&#x00A0;=&#x00A0;error&#x00A0;"usage:&#x00A0;infile&#x00A0;scale&#x00A0;-o&#x00A0;outfile"
 &#x00A0;<br />{
 &#x00A0;<br />&#x00A0;&#x00A0;infile&#x00A0;=&#x00A0;Image_file&#x00A0;argv?1;
 &#x00A0;<br />&#x00A0;&#x00A0;scale&#x00A0;=&#x00A0;parse_float&#x00A0;argv?2;
 &#x00A0;<br />} 
</div>
<!--l. 618--><p class="nopar" >
<!--l. 620--><p class="noindent" >The first line needs to be the path to <span 
class="phvr7t-x-x-80">nip2 </span>on your system.
Use <span 
class="phvr7t-x-x-80">which nip2 </span>to find the path if you don&#8217;t know it. Mark the
file as executable with <span 
class="phvr7t-x-x-80">chmod +x brighten</span>, then use it on one
of your image files with:
                                                                                       

                                                                                       
  <div class="verbatim" id="verbatim-17">
brighten&#x00A0;fred.jpg&#x00A0;1.5&#x00A0;-o&#x00A0;bright_fred.png
</div>
<!--l. 627--><p class="nopar" >
<!--l. 629--><p class="noindent" >See Chapter&#x00A0;<a 
href="nipguidech6.html#x31-570006">6<!--tex4ht:ref: sec:program --></a> for details on the programming language.
This program multiplies each input pixel by the constant,
producing a floating point image, then then clips the result
back to the same format as the original image (usually 8-bit
unsigned).
<!--l. 635--><p class="indent" >  <span 
class="phvr7t-x-x-80">nip2 </span>takes a while (a few seconds) to start up, so this isn&#8217;t
going to be appropriate for small images or simple
calculations. But for complex operations, or operations on
large images, this mode can be very useful.
<!--l. 639--><p class="noindent" >
  <h4 class="subsectionHead"><span class="titlemark">4.5.3    </span> <a 
 id="x21-420004.5.3"></a>Using <span 
class="phvr7t-x-x-80">&#8211;set</span></h4>
<!--l. 641--><p class="noindent" >The <span 
class="phvr7t-x-x-80">&#8211;set </span>option (which can be abbreviated to <span 
class="phvr7t-x-x-80">-=</span>) lets you
make changes to a workspace after loading it. Suppose the
workspace <span 
class="phvr7t-x-x-80">test.ws </span>has a row called <span 
class="phvr7t-x-x-80">A1 </span>with the value 12.
Then entering:
                                                 <div class="verbatim" id="verbatim-18">
  nip2&#x00A0;test.ws&#x00A0;--set&#x00A0;Workspaces.test.A1=45 
</div>
<!--l. 647--><p class="nopar" >
<!--l. 649--><p class="noindent" >Will, as normal, start <span 
class="phvr7t-x-x-80">nip2 </span>and load <span 
class="phvr7t-x-x-80">test.ws</span>. But before
the first recalculation, <span 
class="phvr7t-x-x-80">nip2 </span>will change the value of <span 
class="phvr7t-x-x-80">A1</span>
to be 45. You can use <span 
class="phvr7t-x-x-80">&#8211;set </span>to create new symbols as
well.
<!--l. 654--><p class="noindent" >
    <h4 class="subsectionHead"><span class="titlemark">4.5.4    </span> <a 
 id="x21-430004.5.4"></a>Other modes</h4>
<!--l. 656--><p class="noindent" >A set of sub-options let you mix up other modes yourself.
For example, it&#8217;s common to want to run a workspace on
many files.
<!--l. 659--><p class="indent" >    Suppose the workspace <span 
class="phvr7t-x-x-80">process.ws </span>loads an image in <span 
class="phvr7t-x-x-80">A1</span>,
performs some processing and produces a result image <span 
class="phvr7t-x-x-80">A10</span>.
If you run <span 
class="phvr7t-x-x-80">nip2 </span>with:
                                                                                       

                                                                                       
  <div class="verbatim" id="verbatim-19">
nip2&#x00A0;-bp&#x00A0;\
&#x00A0;<br />&#x00A0;&#x00A0;-=&#x00A0;'Workspaces.process.A1=Image_file&#x00A0;"fred.jpg"'&#x00A0;\
&#x00A0;<br />&#x00A0;&#x00A0;-=&#x00A0;main=Workspaces.process.A10&#x00A0;\
&#x00A0;<br />&#x00A0;&#x00A0;-o&#x00A0;fred.jpg&#x00A0;process.ws
</div>
<!--l. 667--><p class="nopar" >
<!--l. 669--><p class="noindent" >This will start <span 
class="phvr7t-x-x-80">nip2 </span>in batch (ie. no GUI) mode (the <span 
class="phvr7t-x-x-80">-b</span>
switch), load <span 
class="phvr7t-x-x-80">process.ws</span>, change <span 
class="phvr7t-x-x-80">A1 </span>to load another file, set
<span 
class="phvr7t-x-x-80">main </span>to be the value of <span 
class="phvr7t-x-x-80">A10 </span>and save the value of <span 
class="phvr7t-x-x-80">A10 </span>to
<span 
class="phvr7t-x-x-80">fred.jpg </span>(the <span 
class="phvr7t-x-x-80">-p </span>switch).
                                           
                                                                                       

                                                                                       
  <!--l. 1--><div class="crosslinks"><p class="noindent">[<a 
href="nipguidese12.html" >prev</a>] [<a 
href="nipguidese12.html#tailnipguidese12.html" >prev-tail</a>] [<a 
href="nipguidese13.html" >front</a>] [<a 
href="nipguidech4.html#nipguidese13.html" >up</a>] </p></div>
<!--l. 1--><p class="indent" >  <a 
 id="tailnipguidese13.html"></a>   
</body></html>