File: TopLevelFunctions.html

package info (click to toggle)
libics 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,196 kB
  • sloc: ansic: 8,873; sh: 4,461; cpp: 770; makefile: 148
file content (1974 lines) | stat: -rw-r--r-- 100,678 bytes parent folder | download
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
  <head>
    <title>libics: Top-Level Interface</title>
    <link rel="stylesheet" href="libics.css" type="text/css" title="default">
    <!--[if lte IE 6]>
    <link rel="stylesheet" href="iexplorefix.css" type="text/css" title="default">
    <![endif]-->
  </head>

  <body>
    <p class=header>libics v.1.7.0 Online Documentation. &copy;2000-2010 by Cris Luengo and others.</p>

    <div class="navbar">
      <ul>
        <li><a href=".">libics home</a></li>
        <li><a href="Documentation.html" class="selected">Documentation</a>
          <ul>
            <li><a href="Usage.html">Usage of libics</a></li>
            <li><a href="TopLevelFunctions.html" class="selected">Top-level interface</a>
              <ul>
                <li><a href="#general">General library functions</a></li>
                <li><a href="#reading">Reading image data</a></li>
                <li><a href="#writing">Writing image data</a></li>
                <li><a href="#metadata">Image metadata functions</a></li>
                <li><a href="#history">History metadata functions</a></li>
                <li><a href="#sensor">Sensor metadata functions</a></li>
                <li><a href="#testing">Testing functions</a></li>
              </ul>
            </li>
            <li><a href="LowLevelFunctions.html">Low-level interface</a></li>
            <li><a href="Ics_Header.html">Ics_Header</a></li>
            <li><a href="Ics_DataRepresentation.html">Ics_DataRepresentation</a></li>
            <li><a href="Ics_ImelRepresentation.html">Ics_ImelRepresentation</a></li>
            <li><a href="Ics_Error.html">Ics_Error</a></li>
            <li><a href="Enums.html">Other enums</a></li>
          </ul>
        </li>
        <li><a href="Credits.html">Credits</a></li>
        <li><a href="Links.html">Links</a></li>
        <li><a href="https://github.com/svi-opensource/libics/releases">Download</a></li>
        <li><a href="https://github.com/svi-opensource/libics">GitHub</a></li>
      </ul>
    </div>

<h1>Top-level interface to libics</h1>

    <p>The functions below represent the <strong>recommended</strong> way of
    reading and writing ICS files using this library. You need to add
    <tt class="preprocess">#include "libics.h"</tt> to your source files.</p>

    <p>Most functions return an
    <tt class="typeident"><a href="Ics_Error.html">Ics_Error</a></tt>
    value. For these functions we have listed the values this function
    could return. If the function completes its task successfully, it returns
    <tt class="constant">IcsErr_Ok</tt>. Some of the error codes
    (like <tt class="constant">IcsErr_NotValidAction</tt>) are returned when
    "asserts" fail. These shouldn't happen if you wrote your program correctly.
    See "<a href="Ics_Error.html">Error codes returned by the library functions</a>"
    for a detailed description of each error code.</p>

    <p>This functions in this page are organized in the following categories,
    and sorted alphabetically:</p>
    <ul>
      <li><a href="#general">General library functions</a></li>
      <li><a href="#reading">Reading image data</a></li>
      <li><a href="#writing">Writing image data</a></li>
      <li><a href="#metadata">Image metadata functions</a></li>
      <li><a href="#history">History metadata functions</a></li>
      <li><a href="#sensor">Sensor metadata functions</a></li>
      <li><a href="#testing">Testing functions</a></li>
    </ul>

<h2><a name="general"></a>General library functions</h2>

  <h3 class="ident"><a name="IcsClose"></a>IcsClose</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsClose</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Close the ICS file. The ics 'stream' is no longer
    valid after this. No files are actually written until this function is
    called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_CompressionProblem</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_FailWriteLine</tt>,
    <tt class="constant">IcsErr_FCloseIcs</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FCopyIds</tt>,
    <tt class="constant">IcsErr_FOpenIcs</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FTempMoveIcs</tt>,
    <tt class="constant">IcsErr_FWriteIcs</tt>,
    <tt class="constant">IcsErr_FWriteIds</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NoLayout</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_TooManyChans</tt>,
    <tt class="constant">IcsErr_TooManyDims</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>,
    <tt class="constant">IcsErr_UnknownDataType</tt>.</p>

  <h3 class="ident"><a name="IcsGetErrorText"></a>IcsGetErrorText</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="funcident">IcsGetErrorText</span>
    (<span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="varident">error</span>);
    </p>

    <p>Returns a pointer to a textual representation of
    the error message in <tt class="varident">error</tt>.

  <h3 class="ident"><a name="IcsGetLibVersion"></a>IcsGetLibVersion</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="funcident">IcsGetLibVersion</span>
    (<span class="keyword">void</span>);
    </p>

    <p>Returns a string that can be used to compare against
    <tt class="constant">ICSLIB_VERSION</tt> to check if the version of the
    library is the same as that of the headers.</p>

  <h3 class="ident"><a name="IcsLoadPreview"></a>IcsLoadPreview</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsLoadPreview</span>
    (<span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">filename</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">planenumber</span>,
    <span class="keyword">void</span>&nbsp;*<span class="varident">dest</span>,
    <span class="keyword">size_t</span>&nbsp;*<span class="varident">xsize</span>,
    <span class="keyword">size_t</span>&nbsp;*<span class="varident">ysize</span>);
    </p>

    <p>Read a 2D preview image out of an ICS file.
    <tt class="varident">*dest</tt> is set to a buffer that you should <tt class="funcident">free</tt>
    yourself. <tt class="varident">*xsize</tt> and <tt class="varident">*ysize</tt> are set to the
    image size, and the buffer is filled with a 2D slice out of the image, converted to 8-bit unsigned
    integers. The slice is chosen with <tt class="varident">planenumber</tt> (see
    <tt class="funcident"><a href="#IcsGetPreviewData">IcsGetPreviewData</a></tt>).

    <p>This function does currently not work when the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>.
    In order to work on 16-bits floats (Ics_real16), the compiler needs to support this
    data type. </p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_BufferTooSmall</tt>,
    <tt class="constant">IcsErr_CompressionProblem</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FailWriteLine</tt>,
    <tt class="constant">IcsErr_FCloseIcs</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FOpenIcs</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIcs</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_FWriteIcs</tt>,
    <tt class="constant">IcsErr_FWriteIds</tt>,
    <tt class="constant">IcsErr_IllegalROI</tt>,
    <tt class="constant">IcsErr_LineOverflow</tt>,
    <tt class="constant">IcsErr_MissBits</tt>,
    <tt class="constant">IcsErr_MissCat</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_MissLayoutSubCat</tt>,
    <tt class="constant">IcsErr_MissParamSubCat</tt>,
    <tt class="constant">IcsErr_MissRepresSubCat</tt>,
    <tt class="constant">IcsErr_MissSensorSubSubCat</tt>,
    <tt class="constant">IcsErr_NoLayout</tt>,
    <tt class="constant">IcsErr_NotIcsFile</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_OutputNotFilled</tt>,
    <tt class="constant">IcsErr_TooManyChans</tt>,
    <tt class="constant">IcsErr_TooManyDims</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>,
    <tt class="constant">IcsErr_UnknownDataType</tt>.</p>

  <h3 class="ident"><a name="IcsOpen"></a>IcsOpen</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsOpen</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;**<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">filename</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">mode</span>);
    </p>

    <p>Open an ICS file for reading
    (<tt class="varident">mode</tt> = <tt class="constant">"r"</tt>)
    or writing
    (<tt class="varident">mode</tt> = <tt class="constant">"w"</tt>)
    or updating
    (<tt class="varident">mode</tt> = <tt class="constant">"rw"</tt>).
    When writing, append a <tt class="constant">"2"</tt> to
    <tt class="varident">mode</tt> to create an ICS version 2.0 file, or a
    <tt class="constant">"1"</tt> for ICS v.1.0 (the default version is 2.0).
    When reading or updating, append an <tt class="constant">"f"</tt> to
    <tt class="varident">mode</tt> to avoid the file extension to be forced to
    <tt class="constant">".ics"</tt>.</p>

    <p>In the  <tt class="constant">"rw"</tt> mode, it is possible to change
    all of the meta-data in the file, but not the actual data. To change the
    data, read in the image in the normal way, change it and then write it
    out.</p>

    <p>The standard requires the <tt class="constant">"C"</tt> locale to be in
    effect when writing the ICS header, which means that numbers are written
    using a dot as a decimal separator, and no separator for thousands. If you
    happen to have an ICS file written using, e.g., the German locale, which
    would contain a number written as <tt class="constant">5.755,34</tt>
    instead of <tt class="constant">5755.34</tt>, you can read this file by
    setting the locale (in C this is done with <tt class="funcident">setlocale</tt>)
    to German, then opening the file with an <tt class="constant">"l"</tt>
    appended to the <tt class="varident">mode</tt> string:</p>

    <p class="synopsis">
    <span class="funcident">IcsOpen</span> (&amp;<span class="varident">ics</span>,
    <tt class="constant">"germanfile.ics"</tt>, <tt class="constant">"rl"</tt>)</p>

    <p>Note that this option does not work when writing a file: all ICS files
    written by this library use the locale specified in the standard. Consequently,
    when updating such an ICS file, it will be converted to the
    <tt class="constant">"C"</tt> locale.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_FCloseIcs</tt>,
    <tt class="constant">IcsErr_FOpenIcs</tt>,
    <tt class="constant">IcsErr_FReadIcs</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>,
    <tt class="constant">IcsErr_LineOverflow</tt>,
    <tt class="constant">IcsErr_MissBits</tt>,
    <tt class="constant">IcsErr_MissCat</tt>,
    <tt class="constant">IcsErr_MissLayoutSubCat</tt>,
    <tt class="constant">IcsErr_MissParamSubCat</tt>,
    <tt class="constant">IcsErr_MissRepresSubCat</tt>,
    <tt class="constant">IcsErr_MissSensorSubSubCat</tt>,
    <tt class="constant">IcsErr_NotIcsFile</tt>,
    <tt class="constant">IcsErr_TooManyChans</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

  <h3 class="ident"><a name="IcsVersion"></a>IcsVersion</h3>

    <p class="synopsis">
    <span class="keyword">int</span>&nbsp;<span class="funcident">IcsVersion</span>
    (<span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">filename</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">forcename</span>);
    </p>

    <p>Returns 0 if the file specified by name is not an ICS file,
    or the version number if it is. When <tt class="varident">forcename</tt> is non-zero,
    the <tt class="constant">".ics"</tt> extension is not added.</p>

<h2><a name="reading"></a>Reading image data</h2>

    <p>These functions are available on files opened for reading.</p>

  <h3 class="ident"><a name="IcsGetData"></a>IcsGetData</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetData</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">void</span>&nbsp;*<span class="varident">dest</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>);
    </p>

    <p>Read the actual image data from an ICS file, as a single block.
    <tt class="varident">n</tt> is the size of the buffer
    <tt class="varident">dest</tt>, which must be the exact same size as
    reported by
    <tt class="funcident"><a href="#IcsGetDataSize">IcsGetDataSize</a></tt></p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

  <h3 class="ident"><a name="IcsGetDataBlock"></a>IcsGetDataBlock</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetDataBlock</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">void</span>&nbsp;*<span class="varident">dest</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>);
    </p>

    <p>Read a portion of the actual image data from an ICS file.
    <tt class="varident">n</tt> is the size of the buffer
    <tt class="varident">dest</tt> in bytes.</p>
    
    <p>When the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>,
    this function can only be called once. That is, only one block of data, starting
    at the beginning, can be read from the file.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

  <h3 class="ident"><a name="IcsGetDataSize"></a>IcsGetDataSize</h3>

    <p class="synopsis">
    <span class="keyword">size_t</span>&nbsp;<span class="funcident">IcsGetDataSize</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href= "Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Returns the size of the data block in bytes.</p>

  <h3 class="ident"><a name="IcsGetDataWithStrides"></a>IcsGetDataWithStrides</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetDataWithStrides</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;void</span>&nbsp;*<span class="varident">src</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>,
    <span class="keyword">const&nbsp;ptrdiff_t</span>&nbsp;*<span class="varident">strides</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">ndims</span>);
    </p>

    <p>Same as
    <tt class="funcident"><a href="#IcsGetData">IcsGetData</a></tt>, except
    a pointer to an array <tt class="varident">strides</tt> is also given.
    <tt class="varident">ndims</tt> is the length of this array and should be
    equal to the dimensionality of the data as returned by
    <tt class="funcident"><a href="#IcsGetLayout">IcsGetLayout</a></tt></p>

    <p>This function does currently not work when the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>.</p>

    <p>The parameter <tt class="varident">n</tt> is ignored.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

  <h3 class="ident"><a name="IcsGetImageSize"></a>IcsGetImageSize</h3>

    <p class="synopsis">
    <span class="keyword">size_t</span>&nbsp;<span class="funcident">IcsGetImageSize</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Returns the size of the image in imels.</p>

  <h3 class="ident"><a name="IcsGetImelSize"></a>IcsGetImelSize</h3>

    <p class="synopsis">
    <span class="keyword">size_t</span>&nbsp;<span class="funcident">IcsGetImelSize</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Returns the size of imels in bytes.</p>

  <h3 class="ident"><a name="IcsGetLayout"></a>IcsGetLayout</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetLayout</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident"><a href="Enums.html#Ics_DataType">Ics_DataType</a></span>&nbsp;*<span class="varident">dt</span>,
    <span class="keyword">int</span>&nbsp;*<span class="varident">ndims</span>,
    <span class="keyword">size_t</span>&nbsp;*<span class="varident">dims</span>);
    </p>

    <p>Retrieve the layout of an ICS image.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetPreviewData"></a>IcsGetPreviewData</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetPreviewData</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">void</span>&nbsp;*<span class="varident">dest</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">planenumber</span>);
    </p>

    <p>Read a plane of the actual image data from an ICS file, and
    convert it to 8-bit unsigned integers.
    <tt class="varident">n</tt> is the size of the buffer
    <tt class="varident">dest</tt> in bytes, and should be equal to
    <tt><span class="varident">dims</span>[<span class="constant">0</span>]*<span class="varident">dims</span>[<span class="constant">1</span>]</tt>,
    as returned by <tt class="funcident"><a href="#IcsGetLayout">IcsGetLayout</a></tt>.
    <tt class="varident">planenumber</tt> is the number of the 2D plane in the file. For example,
    to read the plane defined by
    <tt>[<span class="constant">:</span>,<span class="constant">:</span>,<span class="constant">m</span>,<span class="constant">n</span>,<span class="constant">k</span>]</tt>,
    set <tt class="varident">planenumber</tt> to
    <tt><span class="constant">m</span> + <span class="constant">n</span>*<span class="varident">dims</span>[<span class="constant">2</span>] +
    <span class="constant">k</span>*<span class="varident">dims</span>[<span class="constant">2</span>]*<span class="varident">dims</span>[<span class="constant">3</span>]</tt>.</p>

    <p>This function does currently not work when the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_BufferTooSmall</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_IllegalROI</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_OutputNotFilled</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>,
    <tt class="constant">IcsErr_UnknownDataType</tt>.</p>

  <h3 class="ident"><a name="IcsGetROIData"></a>IcsGetROIData</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetROIData</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;size_t</span>&nbsp;*<span class="varident">offset</span>,
    <span class="keyword">const&nbsp;size_t</span>&nbsp;*<span class="varident">size</span>,
    <span class="keyword">const&nbsp;size_t</span>&nbsp;*<span class="varident">sampling</span>,
    <span class="keyword">void</span>&nbsp;*<span class="varident">dest</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>);
    </p>

    <p>Read a square region of the actual image from an ICS file. The
    region is defined by <tt class="varident">offset</tt> and <tt class="varident">size</tt>,
    both of which are integer arrays with <tt class="varident">ndims</tt> elements (as
    reported by <tt class="funcident"><a href="#IcsGetLayout">IcsGetLayout</a></tt>).
    <tt class="varident">sampling</tt> allows you to sub-sample the image. It also is an
    array with <tt class="varident">ndims</tt> elements. If any of these parameters is
    set to <tt class="constant">NULL</tt>, the default is used (the offset is 0, the size
    is equal to the image size, and the sampling is 1 in each direction).</p>

    <p>This function does currently not work when the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BitsVsSizeConfl</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_BufferTooSmall</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FCloseIds</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_IllegalROI</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_OutputNotFilled</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

  <h3 class="ident"><a name="IcsGetSignificantBits"></a>IcsGetSignificantBits</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetSignificantBits</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">size_t</span>&nbsp;*<span class="varident">nbits</span>);
    </p>

    <p>Get the number of significant bits.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSkipDataBlock"></a>IcsSkipDataBlock</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSkipDataBlock</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>);
    </p>

    <p>Skip a portion of the actual image data in an ICS file.
    <tt class="varident">n</tt> is the number of bytes to skip. Use this function
    together with
    <tt class="funcident"><a href="#IcsGetDataBlock">IcsGetDataBlock</a></tt> to
    read in the portion of the image you are interested in. Note the function
    <tt class="funcident"><a href="#IcsGetROIData">IcsGetROIData</a></tt>, which
    might simplifies this task.</p>

    <p>This function does currently not work when the data is compressed with
    <tt class="constant"><a href="Enums.html#Ics_Compression">IcsCompr_compress</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_BlockNotAllowed</tt>,
    <tt class="constant">IcsErr_CorruptedStream</tt>,
    <tt class="constant">IcsErr_DecompressionProblem</tt>,
    <tt class="constant">IcsErr_EndOfStream</tt>,
    <tt class="constant">IcsErr_FOpenIds</tt>,
    <tt class="constant">IcsErr_FReadIds</tt>,
    <tt class="constant">IcsErr_MissingData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_UnknownCompression</tt>.</p>

<h2><a name="writing"></a>Writing image data</h2>

    <p>These functions are available on files opened for writing.</p>

  <h3 class="ident"><a name="IcsSetCompression"></a>IcsSetCompression</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetCompression</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident"><a href="Enums.html#Ics_Compression">Ics_Compression</a></span>&nbsp;<span class="varident"> compression</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">level</span>);
    </p>

    <p>Set the compression method and compression
    parameter. Data is written uncompressed by default.
    If you try to set the compression to
    <tt class="constant">IcsCompr_compress</tt>, you'll
    get <tt class="constant">IcsCompr_gzip</tt> instead.
    See available methods and significance of the parameter
    at the <tt class="typeident"><a href="Enums.html#Ics_Compression">Ics_Compression</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetData"></a>IcsSetData</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetData</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;void</span>&nbsp;*<span class="varident">src</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>);
    </p>

    <p>Set the image data for an ICS image. The pointer to
    this data must be accessible until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> has been called.
    If the size <tt class="varident">n</tt> of the data is not equal to what is
    expected according to the image sizes set previously by
    <tt class="funcident"><a href="#IcsSetLayout">IcsSetLayout</a></tt>, a value
    of <tt class="constant">IcsErr_FSizeConflict</tt> is returned.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_DuplicateData</tt>,
    <tt class="constant">IcsErr_FSizeConflict</tt>,
    <tt class="constant">IcsErr_NoLayout</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetDataWithStrides"></a>IcsSetDataWithStrides</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetDataWithStrides</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;void</span>&nbsp;*<span class="varident">src</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">n</span>,
    <span class="keyword">const&nbsp;ptrdiff_t</span>&nbsp;*<span class="varident">strides</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">ndims</span>);
    </p>

    <p>Same as
    <tt class="funcident"><a href="#IcsSetData">IcsSetData</a></tt>, except
    a pointer to an array <tt class="varident">strides</tt> is also given.
    This array must be accessible until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> has been called.
    <tt class="varident">ndims</tt> is the length of this array and should be
    equal to the dimensionality of the data as specified earlier through
    <tt class="funcident"><a href="#IcsSetLayout">IcsSetLayout</a></tt></p>

    <p>The parameter <tt class="varident">n</tt> is ignored.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_DuplicateData</tt>,
    <tt class="constant">IcsErr_FSizeConflict</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>,
    <tt class="constant">IcsErr_NoLayout</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetLayout"></a>IcsSetLayout</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetLayout</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident"><a href="Enums.html#Ics_DataType">Ics_DataType</a></span>&nbsp;<span class="varident">dt</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">ndims</span>,
    <span class="keyword">const&nbsp;size_t</span>&nbsp;*<span class="varident">dims</span>);
    </p>

    <p>Set the layout for an ICS image.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_TooManyDims</tt>.</p>

  <h3 class="ident"><a name="IcsSetSignificantBits"></a>IcsSetSignificantBits</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSignificantBits</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">nbits</span>);
    </p>

    <p>Set the number of significant bits.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NoLayout</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSource"></a>IcsSetSource</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSource</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">fname</span>,
    <span class="keyword">size_t</span>&nbsp;<span class="varident">offset</span>);
    </p>

    <p>Set the image source parameter for an ICS version
    2.0 file.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_DuplicateData</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetByteOrder"></a>IcsSetByteOrder</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetByteOrder</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident"><a href="Enums.html#Ics_ByteOrder">Ics_ByteOrder</a></span>&nbsp;*<span class="varident">order</span>);
    </p>

    <p>Set the image source byte order for an ICS version 2.0 file. Only valid if
    writing, and only valid after calling
    <tt class="funcident"><a href="#IcsSetSource">IcsSetSource</a></tt>. If the data
    type is changed after this call, the byte order information written to file might
    not be correct.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>.</p>

<h2><a name="metadata"></a>Image metadata functions</h2>

  <h3 class="ident"><a name="IcsGetCoordinateSystem"></a>IcsGetCoordinateSystem</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetCoordinateSystem</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">coord</span>);
    </p>

    <p>Get the coordinate system used in the positioning of
    the pixels. Related to <tt class="funcident"><a href="#IcsGetPosition">
    IcsGetPosition</a></tt>. The default is <tt class="constant">
    "video"</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetImelUnits"></a>IcsGetImelUnits</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetImelUnits</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">scale</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">units</span>);
    </p>

    <p>Set the position of the pixel values: the offset and
    scaling, and the units in which to measure. If you are not interested in
    one of the parameters, set the pointer to <tt class="constant">NULL</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetImelUnitsF"></a>IcsGetImelUnitsF</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetImelUnitsF</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp<span class="keyword">const</span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">scale</span>,
    <span class="keyword">const char</span>&nbsp;*<span class="varident">units</span>);
    </p>

    <p>Same as <tt class="funcident"><a href="#IcsGetImelUnits">IcsGetImelUnits</a></tt>,
    but doesn't copy the units string. Output pointer <tt class="varident">units</tt>
    is set to the internal buffer, which will be valid until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> is called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetOrder"></a>IcsGetOrder</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetOrder</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">order</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">label</span>);
    </p>

    <p>Get the ordering of the dimensions in the image. The
    ordering is defined by names and labels for each dimension. The defaults
    are x, y, z, t (time) and p (probe). Dimensions start at 0.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetOrderF"></a>IcsGetOrderF</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetOrderF</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">const char</span>&nbsp;**<span class="varident">order</span>,
    <span class="keyword">const char</span>&nbsp;**<span class="varident">label</span>);
    </p>

    <p>Same as <tt class="funcident"><a href="#IcsGetOrder">IcsGetOrder</a></tt>,
    but doesn't copy the order or label strings. Output pointers <tt class="varident">order</tt>
    and <tt class="varident">label</tt> are set to the internal buffers, which will
    be valid until <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> is called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetPosition"></a>IcsGetPosition</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetPosition</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">scale</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">units</span>);
    </p>

    <p>Get the position of the image in the real world: the
    origin of the first pixel, the distances between pixels and the units in
    which to measure. If you are not interested in one of the parameters, set
    the pointer to <tt class="constant">NULL</tt>. Dimensions start at 0.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetPositionF"></a>IcsGetPositionF</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetPositionF</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;*<span class="varident">scale</span>,
    <span class="keyword">const char</span>&nbsp;**<span class="varident">units</span>);
    </p>

    <p>Same as <tt class="funcident"><a href="#IcsGetPosition">IcsGetPosition</a></tt>,
    but doesn't copy the units string. Output pointer <tt class="varident">units</tt>
    is set to the internal buffer, which will be valid until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> is called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetScilType"></a>IcsGetScilType</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetScilType</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">sciltype</span>);
    </p>

    <p>Get the string for the SCIL_TYPE parameter. This string is
    used only by SCIL_Image.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGuessScilType"></a>IcsGuessScilType</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGuessScilType</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>As
    <tt class="funcident"><a href="#IcsSetScilType">IcsSetScilType</a></tt>,
    sets the string for the SCIL_TYPE parameter. This function creates a string
    according to the values previously specified using
    <tt class="funcident"><a href="#IcsSetLayout">IcsSetLayout</a></tt>.
    It can create any of these strings:
    <tt class="constant">"g2d"</tt>, <tt class="constant">"g3d"</tt>,
    <tt class="constant">"f2d"</tt>, <tt class="constant">"f3d"</tt>,
    <tt class="constant">"c2d"</tt> and <tt class="constant">"c3d"</tt>.
    This string is used only by SCIL_Image, and is required if you want to read
    the image using SCIL_Image. </p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NoScilType</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetCoordinateSystem"></a>IcsSetCoordinateSystem</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetCoordinateSystem</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">coord</span>);
    </p>

    <p>Set the coordinate system used in the positioning of
    the pixels. Related to
    <tt class="funcident"><a href="#IcsSetPosition">IcsSetPosition</a></tt>.
    The default is <tt class="constant">"video"</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetImelUnits"></a>IcsSetImelUnits</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetImelUnits</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">double</span>&nbsp;<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;<span class="varident">scale</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">units</span>);
    </p>

    <p>Set the position of the pixel values: the offset and
    scaling, and the units in which to measure. If units is
    <tt class="constant">NULL</tt> or empty, it is set to the default value
    of <tt class="constant">"relative"</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetPosition"></a>IcsSetPosition</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetPosition</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">double</span>&nbsp;<span class="varident">origin</span>,
    <span class="keyword">double</span>&nbsp;<span class="varident">scale</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">units</span>);
    </p>

    <p>Set the position of the image in the real world: the
    origin of the first pixel, the distances between pixels and the units in
    which to measure. If <tt class="varident">units</tt> is <tt class=
    "constant">NULL</tt> or empty, it is set to the default value of <tt
    class="constant">"undefined"</tt>. Dimensions start at 0.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetOrder"></a>IcsSetOrder</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetOrder</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">dimension</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">order</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">label</span>);
    </p>

    <p>Set the ordering of the dimensions in the image. The
    ordering is defined by providing names and labels for each dimension. The
    defaults are x, y, z, t (time) and p (probe). Dimensions start at 0.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetScilType"></a>IcsSetScilType</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetScilType</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">sciltype</span>);
    </p>

    <p>Set the string for the SCIL_TYPE parameter. This string
    is used only by SCIL_Image, and is required if you want to read the image using
    SCIL_Image.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

<h2><a name="history"></a>History metadata functions</h2>

    <p>The functions below give access to the history lines. The structure
    where these are stored is hidden from the user, making these functions
    the only method of access. A history line in an ICS file starts with
    the token "history", then has an optional key token, and then any
    string. These three parts are separated by tab characters, but the
    string can contain tab characters also, effectively allowing the user
    even more subdivisions in the hierarchy. The history lines can contain
    any information the user wishes to put into the file.</p>

    <p>Some functions below use <tt class="typeident">Ics_HistoryIterator</tt>,
    a struct initialized by
    <tt class="funcident"><a href="#IcsNewHistoryIterator">IcsNewHistoryIterator</a></tt>.
    It is always set to point to the next available string, and also contains
    the index to the previously retrieved string. It is possible to set up an
    iterator to fetch each of the history strings in turn, or to fetch only
    those that have a particular key.</p>

  <h3 class="ident"><a name="IcsAddHistoryString"></a>IcsAddHistoryString</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsAddHistoryString</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">key</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">value</span>);
    </p>

    <p>Add history lines to the ICS file. <tt class="varident">key</tt> can be
    <tt class="constant">NULL</tt> or <tt class="constant">""</tt>, but value
    must point to a string. Neither strings can contain newline characters, and
    <tt class="varident">key</tt> cannot contain tab characters either.</p>

    <p><tt class="funcident">IcsAddHistory</tt> is defined as an alias for this
    function, for backwards compatibility.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>,
    <tt class="constant">IcsErr_LineOverflow</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsDeleteHistory"></a>IcsDeleteHistory</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsDeleteHistory</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">key</span>);
    </p>

    <p>Delete all history lines with key <tt class="varident">key</tt>. If
    <tt class="varident">key</tt> is <tt class="constant">NULL</tt> or
    <tt class="constant">""</tt>, it deletes all the history lines.</p>

    <p class="info"><span class="headtxt">errors</span>:
    none.</p>

  <h3 class="ident"><a name="IcsDeleteHistoryStringI"></a>IcsDeleteHistoryStringI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsDeleteHistoryStringI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>);
    </p>

    <p>Delete the last history lines retrieved through <tt class="varident">it</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    none.</p>

  <h3 class="ident"><a name="IcsGetHistoryKeyValue"></a>IcsGetHistoryKeyValue</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryKeyValue</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">key</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">value</span>,
    <span class="typeident"><a href="Enums.html#Ics_HistoryWhich">Ics_HistoryWhich</a></span>&nbsp;<span class="varident">which</span>);
    </p>

    <p>Get the history lines from the ICS file. <tt class="varident">key</tt>
    must have at least <tt class="constant">ICS_STRLEN_TOKEN</tt> characters
    allocated, and <tt class="varident">value</tt> at least
    <tt class="constant">ICS_LINE_LENGTH</tt>. <tt class="varident">key</tt>
    can be <tt class="constant">NULL</tt>, in which case the key will be discarded.
    The <tt class="varident">which</tt> parameter must be set to
    <tt class="constant">IcsWhich_First</tt> to read the first string in the buffer,
    and to <tt class="constant">IcsWhich_Next</tt> in subsequent calls to get the
    other strings.</p>

    <p><tt class="funcident">IcsGetHistoryKeyValue</tt> shares and internal iterator with
    <tt class="funcident"><a href="#IcsGetHistoryString">IcsGetHistoryString</a></tt>,
    and calls
    <tt class="funcident"><a href="#IcsGetHistoryKeyValueI">IcsGetHistoryKeyValueI</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetHistoryKeyValueI"></a>IcsGetHistoryKeyValueI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryKeyValueI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">key</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">value</span>);
    </p>

    <p>Get the history lines from the ICS file. <tt class="varident">key</tt>
    must have at least <tt class="constant">ICS_STRLEN_TOKEN</tt> characters
    allocated, and <tt class="varident">value</tt> at least
    <tt class="constant">ICS_LINE_LENGTH</tt>. <tt class="varident">key</tt>
    can be <tt class="constant">NULL</tt>, in which case the key will be discarded.
    The <tt class="varident">it</tt> parameter must point to a
    <tt class="typeident">Ics_HistoryIterator</tt> structure initialized by
    <tt class="funcident"><a href="#IcsNewHistoryIterator">IcsNewHistoryIterator</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetHistoryKeyValueIF"></a>IcsGetHistoryKeyValueIF</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryKeyValueIF</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">key</span>,
    <span class="keyword">const char</span>&nbsp;**<span class="varident">value</span>);
    </p>

    <p>Same as <tt class="funcident"><a href="#IcsGetHistoryKeyValueI">IcsGetHistoryKeyValueI</a></tt>,
    but doesn't copy the value string. Output pointer <tt class="varident">value</tt>
    is set to the internal buffer, which will be valid until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> or
    <tt class="funcident"><a href="#IcsFreeHistory">IcsFreeHistory</a></tt>
    are called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetHistoryString"></a>IcsGetHistoryString</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryString</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">string</span>,
    <span class="typeident"><a href="Enums.html#Ics_HistoryWhich">Ics_HistoryWhich</a></span>&nbsp;<span class="varident">which</span>);
    </p>

    <p>Get the history lines from the ICS file. <tt class="varident">string</tt>
    must have at least <tt class="constant">ICS_LINE_LENGTH</tt> characters allocated.
    The <tt class="varident">which</tt> parameter must be set to
    <tt class="constant">IcsWhich_First</tt> to read the first string in the buffer,
    and to <tt class="constant">IcsWhich_Next</tt> in subsequent calls to get the
    other strings.</p>

    <p><tt class="funcident">IcsGetHistoryString</tt> shares and internal iterator with
    <tt class="funcident"><a href="#IcsGetHistoryKeyValue">IcsGetHistoryKeyValue</a></tt>,
    and calls
    <tt class="funcident"><a href="#IcsGetHistoryStringI">IcsGetHistoryStringI</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetHistoryStringI"></a>IcsGetHistoryStringI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryStringI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">string</span>);
    </p>

    <p>Get the history lines from the ICS file. <tt class="varident">string</tt>
    must have at least <tt class="constant">ICS_LINE_LENGTH</tt> characters allocated.
    The <tt class="varident">it</tt> parameter must point to a
    <tt class="typeident">Ics_HistoryIterator</tt> structure initialized by
    <tt class="funcident"><a href="#IcsNewHistoryIterator">IcsNewHistoryIterator</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetHistoryStringIF"></a>IcsGetHistoryStringIF</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetHistoryStringIF</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">const char</span>&nbsp;**<span class="varident">string</span>);
    </p>

    <p>Same as <tt class="funcident"><a href="#IcsGetHistoryKeyValueI">IcsGetHistoryKeyValueI</a></tt>,
    but doesn't copy the string. Output pointer <tt class="varident">string</tt>
    is set to the internal buffer, which will be valid until
    <tt class="funcident"><a href="#IcsClose">IcsClose</a></tt> or
    <tt class="funcident"><a href="#IcsFreeHistory">IcsFreeHistory</a></tt>
    are called.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetNumHistoryStrings"></a>IcsGetNumHistoryStrings</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetNumHistoryStrings</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;*<span class="varident">num</span>);
    </p>

    <p>Get the number of history lines from the ICS file. <tt class="varident">num</tt>
    is the number of times you can call
    <tt class="funcident"><a href="#IcsGetHistoryString">IcsGetHistoryString</a></tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsNewHistoryIterator"></a>IcsNewHistoryIterator</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsNewHistoryIterator</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">char</span>&nbsp;*<span class="varident">key</span>);
    </p>

    <p>Initializes a history iterator. <tt class="varident">key</tt>
    can be <tt class="constant">NULL</tt>.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_EndOfHistory</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsReplaceHistoryStringI"></a>IcsReplaceHistoryStringI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsReplaceHistoryStringI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="typeident">Ics_HistoryIterator</span>&nbsp;*<span class="varident">it</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">key</span>,
    <span class="keyword">const&nbsp;char</span>&nbsp;*<span class="varident">value</span>);
    </p>

    <p>Replace the last history lines retrieved through <tt class="varident">it</tt>.
    <tt class="varident">key</tt> can be <tt class="constant">NULL</tt> or
    <tt class="constant">""</tt>, but value must point to a string. Neither strings
    can contain newline characters, and <tt class="varident">key</tt> cannot contain
    tab characters either.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_Alloc</tt>,
    <tt class="constant">IcsErr_IllParameter</tt>,
    <tt class="constant">IcsErr_LineOverflow</tt>,
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

<h2><a name="sensor"></a>Sensor metadata functions</h2>

    <p>The functions below give access to the sensor parameters. For most
    parameters dedicated Set and Get functions are provided. However, some
    parameters can only be accessed using generic Set and Get functions,
    along with a 
    <tt class="funcident"><a href="Ics_Header.html#MicroscopyParamTokens">token</a></tt> 
    specifying the parameter. The Set functions all perform 
    error checking and insist that the ICS structure is in writing or updating mode.  
    Please note that
    <tt class="funcident"><a href="#IcsEnableWriteSensor">IcsEnableWriteSensor</a></tt>
    must be called to enable writing the sensor parameters to file.
    To use these functions you need to add
    <tt class="preprocess">#include "libics_sensor.h"</tt>
    to your source files.</p>

  <h3 class="ident"><a name="IcsEnableWriteSensor"></a>IcsEnableWriteSensor</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsEnableWriteSensor</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">enable</span>);
    </p>

    <p>Enable (or disable) writing the sensor parameters to disk.  The second
    parameter must be non-zero for enable, or zero for disable.</p>

  <h3 class="ident"><a name="IcsGetSensorChannels"></a>IcsGetSensorChannels</h3>

    <p class="synopsis">
    <span class="keyword">int</span>
    <span class="funcident">IcsGetSensorChannels</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the number of sensor channels.</p>

  <h3 class="ident"><a name="IcsGetSensorDetectors"></a>IcsGetSensorDetectors</h3>

    <p class="synopsis">
    <span class="keyword">int</span>
    <span class="funcident">IcsGetSensorDetectors</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the number of sensor detectors.</p>

  <h3 class="ident"><a name="IcsGetSensorParameter"></a>IcsGetSensorParameter</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsGetSensorParameter</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">double</span>&nbsp;*<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>
    *<span class="varident">state</span>);
    </p>

    <p>Generic get function for parameters represented by doubles.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetSensorParameterVector"></a>IcsGetSensorParameterVector</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsGetSensorParameterVector</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">const</span>&nbsp;<span class="keyword">double</span>&nbsp;**<span class="varident">values</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>
    *<span class="varident">state</span>);
    </p>

    <p>Generic get function for parameters represented by a vector of doubles. The double **values
    represents a pointer to an array of doubles, which is set by the function. </p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetSensorParameterMatrix"></a>IcsGetSensorParameterMatrix</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsGetSensorParameterMatrix</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">const</span>&nbsp;<span class="keyword">double</span>&nbsp;**<span class="varident">values</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>
    *<span class="varident">state</span>);
    </p>

    <p>Generic get function for parameters represented by a matrix of doubles. The double **values
    represents a pointer to a <b><u>flattened</u></b> array of doubles, which is set by the function. </p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetSensorParameterInt"></a>IcsGetSensorParameterInt</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetSensorParameterInt</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">int</span>&nbsp;*<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>
    *<span class="varident">state</span>);
    </p>

    <p>Generic get function for parameters represented by ints.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetSensorParameterString"></a>IcsGetSensorParameterString</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsGetSensorParameterString</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">const</span>&nbsp;<span class="keyword">char</span>&nbsp;**<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;*<span class="varident">state</span>);
    </p>

    <p>Generic get function for parameters represented by a string. The char **value
    represents a pointer to a char array, which is set by the function. </p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsGetSensorEmissionWavelength"></a>IcsGetSensorEmissionWavelength</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorEmissionWavelength</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>);
    </p>

    <p>Return the emission wavelength for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorExcitationWavelength"></a>IcsGetSensorExcitationWavelength</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorExcitationWavelength</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>);
    </p>

    <p>Return the excitation wavelength for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorLensRI"></a>IcsGetSensorLensRI</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorLensRI</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the design medium refractive index.</p>

  <h3 class="ident"><a name="IcsGetSensorMediumRI"></a>IcsGetSensorMediumRI</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorMediumRI</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the embedding medium refractive index.</p>

  <h3 class="ident"><a name="IcsGetSensorModel"></a>IcsGetSensorModel</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>*
    <span class="funcident">IcsGetSensorModel</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return a pointer to the sensor model string.</p>

  <h3 class="ident"><a name="IcsGetSensorNumAperture"></a>IcsGetSensorNumAperture</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorNumAperture</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the sensor numerical apperture.</p>

  <h3 class="ident"><a name="IcsGetSensorPhotonCount"></a>IcsGetSensorPhotonCount</h3>

    <p class="synopsis">
    <span class="keyword">int</span>
    <span class="funcident">IcsGetSensorPhotonCount</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the excitation photon count for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorPinholeRadius"></a>IcsGetSensorPinholeRadius</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorPinholeRadius</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the pinhole radius for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorPinholeSpacing"></a>IcsGetSensorPinholeSpacing</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorPinholeSpacing</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Return the Nipkow Disk pinhole spacing.</p>

  <h3 class="ident"><a name="IcsGetSensorSTEDDepletionMode"></a>IcsGetSensorSTEDDepletionMode</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>*
    <span class="funcident">IcsGetSensorSTEDDepletionMode</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return a pointer to the STED depletion mode string for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorSTEDImmFraction"></a>IcsGetSensorSTEDImmFraction</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorSTEDImmFraction</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the STED immunity fraction for a given channel.</p>
    
  <h3 class="ident"><a name="IcsGetSensorSTEDLambda"></a>IcsGetSensorSTEDLambda</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorSTEDLambda</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the STED wavelength for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorSTEDPPMode"></a>IcsGetSensorSTEDPPMode</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>*
    <span class="funcident">IcsGetSensorSTEDPPMode</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return a pointer to the STED phase plate mode string for a given channel.</p>
    
  <h3 class="ident"><a name="IcsGetSensorSTEDSatFactor"></a>IcsGetSensorSTEDSatFactor</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorSTEDSatFactor</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the STED saturation factor for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorSTEDVPPM"></a>IcsGetSensorSTEDVPPM</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorSTEDVPPM</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the STED vortex to phase plate mix for a given channel.</p>
    
  <h3 class="ident"><a name="IcsGetSensorDetectorPPU"></a>IcsGetSensorDetectorPPU</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorDetectorPPU</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return photons per unit for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorDetectorBaseline"></a>IcsGetSensorDetectorBaseline</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorDetectorBaseline</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the baseline for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorDetectorLineAvgCnt"></a>IcsGetSensorDetectorLineAvgCnt</h3>

    <p class="synopsis">
    <span class="keyword">double</span>
    <span class="funcident">IcsGetSensorDetectorLineAvgCnt</span>
    (<<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return the amount of line averaging for a given channel.</p>

  <h3 class="ident"><a name="IcsGetSensorType"></a>IcsGetSensorType</h3>

    <p class="synopsis">
    <span class="keyword">const&nbsp;char</span>*
    <span class="funcident">IcsGetSensorType</span>
    (<span class="keyword">const</span>&nbsp;<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>);
    </p>

    <p>Return a pointer to the sensor type string for a given channel.</p>

  <h3 class="ident"><a name="IcsSetSensorChannels"></a>IcsSetSensorChannels</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorChannels</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channels</span>);
    </p>

    <p>Set the number of sensor channels.  This number may not exceed
    <tt class="constant">ICS_MAX_LAMBDA</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorDetectors"></a>IcsSetSensorDetectors</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorDetectors</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">detectors</span>);
    </p>

    <p>Set the number of sensor detectors.  This number may not exceed
    <tt class="constant">ICS_MAX_DETECT</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorParameter"></a>IcsSetSensorParameter</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSensorParameter</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">double</span>&nbsp;<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;<span class="varident">state</span>);
    </p>

    <p>Generic set function for parameters represented by doubles. Note that you 
    must also set the state of the parameter.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorParameterVector"></a>IcsSetSensorParameterVector</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSensorParameterVector</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>
    <span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">nValues</span>, 
    <span class="keyword">double</span>&nbsp;*<span class="varident">values</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;<span class="varident">state</span>);
    </p>

    <p>Generic set function for parameters represented by a vector of doubles. 
    Double *values represents an array of doubles and nValues specifies the size
    of the vector. Note that you must also set the state of the parameter.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorParameterMatrix"></a>IcsSetSensorParameterMatrix</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSensorParameterMatrix</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">nValues</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">mValues</span>, 
    <span class="keyword">double</span>&nbsp;*<span class="varident">values</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;<span class="varident">state</span>);
    </p>

    <p>Generic set function for parameters represented by a matrix of doubles. 
    Double *values represents a <b>flattened</b> array of doubles and (nValues, mValues) 
    specifies the size of the matrix. Note that you must also set the state of the parameter.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorParameterInt"></a>IcsSetSensorParameterInt</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSensorParameterInt</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>&nbsp;<span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;<span class="varident">state</span>);
    </p>

    <p>Generic set function for parameters represented by ints. Note that you 
    must also set the state of the parameter.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorParameterString"></a>IcsSetSensorParameterString</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="funcident">IcsSetSensorParameterString</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;*<span class="varident">ics</span>, 
    <span class="typeident"><a href="Ics_Header.html#MicroscopyParamTokens">Ics_SensorParameter</a></span>
    <span class="varident">parameter</span>, 
    <span class="keyword">int</span>&nbsp;<span class="varident">channel</span>, 
    <span class="keyword">const</span>&nbsp;<span class="keyword">char</span>
    *<span class="varident">value</span>,
    <span class="typeident"><a href="Ics_Header.html#SensorStates">Ics_SensorState</a></span>&nbsp;<span class="varident">state</span>);
    </p>

    <p>Generic set function for parameters represented by a string. Note that you 
    must also set the state of the parameter.</p>

    <p class="info"><span class="headtxt">errors</span>:
    <tt class="constant">IcsErr_NotValidAction</tt>.</p>

  <h3 class="ident"><a name="IcsSetSensorEmissionWavelength"></a>IcsSetSensorEmissionWavelength</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorEmissionWavelength</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">wl</span>);
    </p>

    <p>Set the emission wavelength for a given channel. The channel index
    must be less than the number of sensor channels.</p>

  <h3 class="ident"><a name="IcsSetSensorExcitationWavelength"></a>IcsSetSensorExcitationWavelength</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorExcitationWavelength</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">wl</span>);
    </p>

    <p>Set the excitation wavelength for a given channel. The channel index
    must be less than the number of sensor channels.</p>

  <h3 class="ident"><a name="IcsSetSensorLensRI"></a>IcsSetSensorLensRI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorLensRI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">double</span>
    <span class="varident">ri</span>);
    </p>

    <p>Set the design medium refractive index.</p>

  <h3 class="ident"><a name="IcsSetSensorMediumRI"></a>IcsSetSensorMediumRI</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorMediumRI</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">double</span>
    <span class="varident">ri</span>);
    </p>

    <p>Set the embedding medium refractive index.</p>

  <h3 class="ident"><a name="IcsSetSensorModel"></a>IcsSetSensorModel</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorModel</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">const&nbsp;char</span>*
    <span class="varident">sensor_model</span>);
    </p>

    <p>Set the sensor model string.</p>

  <h3 class="ident"><a name="IcsSetSensorNumAperture"></a>IcsSetSensorNumAperture</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorNumAperture</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">double</span>
    <span class="varident">na</span>);
    </p>

    <p>Set the sensor numerical aperture.</p>

  <h3 class="ident"><a name="IcsSetSensorPhotonCount"></a>IcsSetSensorPhotonCount</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorPhotonCount</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">int</span>
    <span class="varident">cnt</span>);
    </p>

    <p>Set the excitation photon count for a given channel. The channel index
    must be less than the number of sensor channels.</p>

  <h3 class="ident"><a name="IcsSetSensorPinholeRadius"></a>IcsSetSensorPinholeRadius</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorPinholeRadius</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">radius</span>);
    </p>

    <p>Set the pinhole radius for a given channel.  The channel index
    must be less than the number of sensor channels.</p>

  <h3 class="ident"><a name="IcsSetSensorPinholeSpacing"></a>IcsSetSensorPinholeSpacing</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorPinholeSpacing</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">double</span>
    <span class="varident">spacing</span>);
    </p>

    <p>Set the Nipkow Disk pinhole spacing.</p>

  <h3 class="ident"><a name="IcsSetSensorSTEDDepletionMode"></a>IcsSetSensorSTEDDepletionMode</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDDepletionMode</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">const&nbsp;char</span>*
    <span class="varident">depletion_mode</span>);
    </p>

    <p>Set the STED depletion mode for a given channel.</p>

  <h3 class="ident"><a name="IcsSetSensorSTEDImmFraction"></a>IcsSetSensorSTEDImmFraction</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDImmFraction</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">fraction</span>);
    </p>

    <p>Set the STED immunity fraction for a given channel.</p>

  <h3 class="ident"><a name="IcsSetSensorSTEDLambda"></a>IcsSetSensorSTEDLambda</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDLambda</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">lambda</span>);
    </p>

    <p>Set the STED wavelength for a given channel.</p>

  <h3 class="ident"><a name="IcsSetSensorSTEDPPMode"></a>IcsSetSensorSTEDPPMode</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDPPMode</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">const&nbsp;char</span>*
    <span class="varident">pp_mode</span>);
    </p>

    <p>Set the STED phase plate mode for a given channel.</p>
    
  <h3 class="ident"><a name="IcsSetSensorSTEDSatFactor"></a>IcsSetSensorSTEDSatFactor</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDSatFactor</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">factor</span>);
    </p>

    <p>Set the STED saturation factor for a given channel.</p>
    
  <h3 class="ident"><a name="IcsSetSensorSTEDVPPM"></a>IcsSetSensorSTEDVPPM</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorSTEDVPPM</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">vppm</span>);
    </p>

    <p>Set the STED vortex to phase plate mix for a given channel.</p>

  <h3 class="ident"><a name="IcsSetSensorDetectorPPU"></a>IcsSetSensorDetectorPPU</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorDetectorPPU</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">ppu</span>);
    </p>

    <p>Set the photons per unit for a given channel.</p>
    
  <h3 class="ident"><a name="IcsSetSensorDetectorBaseline"></a>IcsSetSensorDetectorBaseline</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorDetectorBaseline</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">baseline</span>);
    </p>

    <p>Set the baseline for a given channel.</p>
    
  <h3 class="ident"><a name="IcsSetSensorDetectorLineAvgCnt"></a>IcsSetSensorDetectorLineAvgCnt</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorDetectorLineAvgCnt</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">double</span>
    <span class="varident">lineAvgCnt</span>);
    </p>

    <p>Set the amount of line averaging for a given channel.</p>
    
  <h3 class="ident"><a name="IcsSetSensorType"></a>IcsSetSensorType</h3>

    <p class="synopsis">
    <span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>
    <span class="funcident">IcsSetSensorType</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>*
    <span class="varident">ics</span>,
    <span class="keyword">int</span>
    <span class="varident">channel</span>,
    <span class="keyword">const&nbsp;char</span>*
    <span class="varident">sensor_type</span>);
    </p>

    <p>Set the sensor type string for a given channel.</p>

<h2><a name="testing"></a>Testing functions</h2>

    <p>The functions below allow the user to see what is happening inside libics.
    You need to add <tt class="preprocess">#include "libics_test.h"</tt> to
    your source files.</p>

  <h3 class="ident"><a name="IcsPrintError"></a>IcsPrintError</h3>

    <p class="synopsis">
    <span class="keyword">void</span>&nbsp;<span class="funcident">IcsPrintError</span>
    (<span class="typeident"><a href="Ics_Error.html">Ics_Error</a></span>&nbsp;<span class="varident">error</span>);
    </p>

    <p>Prints a textual representation of the error message
    in <tt class="varident">error</tt> to <tt class="constant">stdout</tt>.
    Uses <tt class="funcident"><a href="#IcsGetErrorText">IcsGetErrorText</a>
    </tt> and <tt class="funcident">printf</tt>.</p>

  <h3 class="ident"><a name="IcsPrintIcs"></a>IcsPrintIcs</h3>

    <p class="synopsis">
    <span class="keyword">void</span>&nbsp;<span class="funcident">IcsPrintIcs</span>
    (<span class="typeident"><a href="Ics_Header.html">ICS</a></span>&nbsp;<span class="keyword">const</span>&nbsp;*<span class="varident">ics</span>);
    </p>

    <p>Prints the contents of the
    <tt class="typeident"><a href="Ics_Header.html">ICS</a></tt>
    structure in <tt class="varident">ics</tt> to <tt class="constant">stdout</tt>.
    Uses <em>only</em> <tt class="funcident">printf</tt>.</p>

  </body>
</html>