[med-svn] [Git][med-team/libics][upstream] New upstream version 1.6.6
Andreas Tille (@tille)
gitlab at salsa.debian.org
Tue Nov 29 10:30:01 GMT 2022
Andreas Tille pushed to branch upstream at Debian Med / libics
Commits:
caf647ea by Andreas Tille at 2022-11-29T11:26:25+01:00
New upstream version 1.6.6
- - - - -
24 changed files:
- CMakeLists.txt
- README
- configure
- configure.ac
- docs/Credits.html
- docs/Documentation.html
- docs/Enums.html
- docs/Ics_DataRepresentation.html
- docs/Ics_Error.html
- docs/Ics_Header.html
- docs/Ics_ImelRepresentation.html
- docs/Links.html
- docs/LowLevelFunctions.html
- docs/TopLevelFunctions.html
- docs/Usage.html
- docs/index.html
- libics.h
- libics_binary.c
- libics_gzip.c
- libics_intern.h
- libics_ll.h
- libics_read.c
- libics_sensor.c
- libics_top.c
Changes:
=====================================
CMakeLists.txt
=====================================
@@ -18,7 +18,7 @@ if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
-project(libics VERSION 1.6.5)
+project(libics VERSION 1.6.6)
# Note: the version number above is not yet used anywhere.
# TODO: rewrite the header file with this version number.
=====================================
README
=====================================
@@ -1,5 +1,5 @@
- libics v.1.6.5
+ libics v.1.6.6
Image Cytometry Standard file reading and writing.
This is the reference library for ICS (Image Cytometry Standard), an
@@ -171,6 +171,15 @@ Which ultimately is based upon stuff written by:
HISTORY
=============
+version 1.6.6
+ - Remove unused variables, avoiding compiler warning.
+ - Reorder cases in libics_top.c to match enum order
+ - Prevent a NULL pointer dereference on ICS syntax error, instead return
+ an Ics error.
+ - Replace fseek by _fseeki64() on Windows (64-bit safe). Based on
+ a patch submitted by Patrick Steele at Bitplane.
+ - For reference, add #define lines for possible string values as
+ used by SVI Huygens.
version 1.6.5
- Fix typo that causes out-of-bounds read.
=====================================
configure
=====================================
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libics 1.6.5.
+# Generated by GNU Autoconf 2.69 for libics 1.6.6.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libics'
PACKAGE_TARNAME='libics'
-PACKAGE_VERSION='1.6.5'
-PACKAGE_STRING='libics 1.6.5'
+PACKAGE_VERSION='1.6.6'
+PACKAGE_STRING='libics 1.6.6'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1335,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libics 1.6.5 to adapt to many kinds of systems.
+\`configure' configures libics 1.6.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1406,7 +1406,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libics 1.6.5:";;
+ short | recursive ) echo "Configuration of libics 1.6.6:";;
esac
cat <<\_ACEOF
@@ -1527,7 +1527,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libics configure 1.6.5
+libics configure 1.6.6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1946,7 +1946,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libics $as_me 1.6.5, which was
+It was created by libics $as_me 1.6.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2813,7 +2813,7 @@ fi
# Define the identity of the package.
PACKAGE='libics'
- VERSION='1.6.5'
+ VERSION='1.6.6'
cat >>confdefs.h <<_ACEOF
@@ -13011,7 +13011,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libics $as_me 1.6.5, which was
+This file was extended by libics $as_me 1.6.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13077,7 +13077,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libics config.status 1.6.5
+libics config.status 1.6.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
=====================================
configure.ac
=====================================
@@ -12,7 +12,7 @@ dnl Written by Peter Verveer, Cris Luengo
dnl
dnl Library version number (make sure to also change it in 'libics.h'):
-AC_INIT([libics], [1.6.5])
+AC_INIT([libics], [1.6.6])
AC_CONFIG_SRCDIR([libics.h])
AC_CONFIG_HEADERS([config.h libics_conf.h])
AC_CONFIG_MACRO_DIR([m4])
=====================================
docs/Credits.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation.
+ <p class=header>libics v.1\.6\.6 Online Documentation.
©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
@@ -66,3 +66,4 @@
</body>
</html>
+
=====================================
docs/Documentation.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -58,3 +58,4 @@
</body>
</html>
+
=====================================
docs/Enums.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -168,3 +168,4 @@
</body>
</html>
+
=====================================
docs/Ics_DataRepresentation.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -92,3 +92,4 @@
</body>
</html>
+
=====================================
docs/Ics_Error.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -201,3 +201,4 @@
</body>
</html>
+
=====================================
docs/Ics_Header.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -600,3 +600,4 @@
</body>
</html>
+
=====================================
docs/Ics_ImelRepresentation.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -79,3 +79,4 @@
</body>
</html>
+
=====================================
docs/Links.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -54,3 +54,4 @@
</body>
</html>
+
=====================================
docs/LowLevelFunctions.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -403,3 +403,4 @@
</body>
</html>
+
=====================================
docs/TopLevelFunctions.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -1967,3 +1967,4 @@
</body>
</html>
+
=====================================
docs/Usage.html
=====================================
@@ -10,7 +10,7 @@
</head>
<body>
- <p class=header>libics v.1.6.4 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation. ©2000-2010 by Cris Luengo and others.</p>
<div class="navbar">
<ul>
@@ -157,3 +157,4 @@
</body>
</html>
+
=====================================
docs/index.html
=====================================
@@ -10,9 +10,9 @@
</head>
<body>
- <p class=header>libics v.1.6.5 Online Documentation.©2000-2010 by Cris Luengo and others.</p>
+ <p class=header>libics v.1.6.6 Online Documentation.©2000-2010 by Cris Luengo and others.</p>
- <h1>libics v.1.6.3<br>
+ <h1>libics v.1.6.6<br>
<span class="subtitle">Image Cytometry Standard file reading and writing.</span></h1>
<p>This is the reference library for ICS (Image Cytometry Standard), an
=====================================
libics.h
=====================================
@@ -1,7 +1,7 @@
/*
* libics: Image Cytometry Standard file reading and writing.
*
- * Copyright 2015-2019, 2021:
+ * Copyright 2015-2019, 2021, 2022:
* Scientific Volume Imaging Holding B.V.
* Laapersveld 63, 1213 VB Hilversum, The Netherlands
* https://www.svi.nl
@@ -50,7 +50,7 @@ extern "C" {
#endif
/* Library versioning is in the form major, minor, patch: */
-#define ICSLIB_VERSION "1.6.5" /* also defined in configure.ac */
+#define ICSLIB_VERSION "1.6.6" /* also defined in configure.ac */
#if defined(__WIN32__) && !defined(WIN32)
#define WIN32
@@ -65,8 +65,10 @@ extern "C" {
function. */
#if defined(WIN32) || defined(WIN64)
#define ICSSTRCASECMP _stricmp
+#define ICSFSEEK _fseeki64
#else
#define ICSSTRCASECMP strcasecmp
+#define ICSFSEEK fseek
#endif
@@ -106,6 +108,100 @@ extern "C" {
#define ICS_LINE_LENGTH 1024 /* maximum length of the lines in the .ics file. */
#define ICS_MAXPATHLEN 512 /* maximum length of the file names. */
+/* The following definitions are used by SVI Huygens. They are included as a
+ reference to which strings may be encountered in ics files written by
+ Huygens. */
+
+/* Define sensor type identifying text strings: */
+
+/* This is an incoherent Wide Field microscope: */
+#define ICS_SENSOR_TYPE_INCOH_WF "IncohWFMicr"
+/* For backwards compatibility, use ICS_SENSOR_TYPE_INCOH_WF instead: */
+#define ICS_SENSOR_TYPE_INCOH_CONV "IncohConvMicr"
+/* This is an incoherent confocal microscope: */
+#define ICS_SENSOR_TYPE_INCOH_CONF "IncohConfMicr"
+/* These are multi photon systems: */
+#define ICS_SENSOR_TYPE_MPHOT_WF "MPhotonWFMicr"
+#define ICS_SENSOR_TYPE_MPHOT_CONF "MPhotonConfMicr"
+/* This is a 4Pi excitation system: */
+#define ICS_SENSOR_TYPE_4PI "4PiMicr"
+/* This is a scanning disk confocal microscope: */
+#define ICS_SENSOR_TYPE_NDCM "NipkowConfMicr"
+/* This is a scanning SoRa disk confocal microscope: */
+#define ICS_SENSOR_TYPE_SORA "SoRaConfMicr"
+/* This is a STED microscope: */
+#define ICS_SENSOR_TYPE_STED "STEDMicr"
+/* This is a Structured Illumination microscope: */
+#define ICS_SENSOR_TYPE_SI "SIMicr"
+/* This is a SPIM microscope: */
+#define ICS_SENSOR_TYPE_SPIM "SPIMMicr"
+/* This is a (VT-)iSIM confocal microscope (iSIM): */
+#define ICS_SENSOR_TYPE_ISIM "ISIMConfMicr"
+/* This is a rescan confocal microscope (RCM): */
+#define ICS_SENSOR_TYPE_RCM "RescanConfMicr"
+/* This is a detector array microscope (AiryScan, NanoSpad): */
+#define ICS_SENSOR_TYPE_ARRDET "ArrDetConfMicr"
+/* This is a total internal reflection microsope (TIRF): */
+#define ICS_SENSOR_TYPE_TIRF "TIRFMicr"
+/* This is a special type used for 3d SMLM calibration data: */
+#define ICS_SENSOR_TYPE_SMLM "SmlmMicr"
+/* This is a brightfield microscope: */
+#define ICS_SENSOR_TYPE_BRIGHT "Brightfield"
+/* This is a Jack-of-all-trades: */
+#define ICS_SENSOR_TYPE_GENERIC "Generic"
+
+/* Define STED depletion modes */
+/* Depletion with a pulse laser. */
+#define ICS_STED_MODE_VORTEX_PULSED "VortexPulsed"
+/* Depletion with a CW laser. */
+#define ICS_STED_MODE_VORTEX_CW "VortexCW"
+/* Depletion with a CW laser and gated detection */
+#define ICS_STED_MODE_VORTEX_CW_GATED "VortexCWGated"
+/* Abberior stedycon. */
+#define ICS_STED_MODE_ABB_STEDYCON "AbberiorStedycon"
+/* Should be last in list. */
+#define ICS_STED_MODE_LAST "StedLast"
+
+/* Define SPIM excitation types */
+#define ICS_SPIM_EXC_SCANNING "Scanning"
+#define ICS_SPIM_EXC_SCANNING_ANNULUS "ScanningAnnulus"
+#define ICS_SPIM_EXC_SCANNING_LATTICE "ScanningLattice"
+#define ICS_SPIM_EXC_CYLINDER "Cylinder"
+#define ICS_SPIM_EXC_GAUSS "Gauss"
+#define ICS_SPIM_EXC_GAUSS_MUVI "GaussMuVi"
+#define ICS_SPIM_EXC_GAUSS_FLAT "GaussFlat"
+#define ICS_SPIM_EXC_LAST "SpimLast"
+
+/* Define scatter models. */
+#define ICS_SCATTER_MODEL_NONE "None"
+#define ICS_SCATTER_MODEL_EXP_2D "Exp2D"
+#define ICS_SCATTER_MODEL_GAUSS_2D "Gauss2D"
+#define ICS_SCATTER_MODEL_MIXED_2D "Mixed2D"
+#define ICS_SCATTER_MODEL_EXP_1D "Exp1D"
+#define ICS_SCATTER_MODEL_LAST "ScatterLast"
+
+/* Define reliability levels of the microscopic parameters */
+#define ICS_TRUST_SAMPLING_X "reported"
+#define ICS_TRUST_SAMPLING_Y "reported"
+#define ICS_TRUST_SAMPLING_Z "reported"
+#define ICS_TRUST_SAMPLING_T "reported"
+#define ICS_TRUST_MICR_TYPE "reported"
+#define ICS_TRUST_CHAN_CNT "default"
+#define ICS_TRUST_IMAGE_DIR "default"
+#define ICS_TRUST_NUM_APERTURE "reported"
+#define ICS_TRUST_OBJ_QUALITY "default"
+#define ICS_TRUST_RI_MEDIA "reported"
+#define ICS_TRUST_RI_LENS "reported"
+#define ICS_TRUST_PINH_RADIUS "reported"
+#define ICS_TRUST_PINH_SPC "reported"
+#define ICS_TRUST_EX_LAMBDA "reported"
+#define ICS_TRUST_EM_LAMBDA "reported"
+#define ICS_TRUST_PHOTON_CNT "reported"
+#define ICS_TRUST_IFACE_PRIM "default"
+#define ICS_TRUST_IFACE_SCND "default"
+
+/* End of definitions that are used specifically by SVI Huygens. */
+
/* These are the known data types for imels. If you use another type, you can't
use the top-level functions: */
@@ -508,6 +604,8 @@ typedef enum {
IcsErr_MissSensorSubCat,
/* Missing sensor subsubcategory: */
IcsErr_MissSensorSubSubCat,
+ /* Missing sensor subsubcategory index: */
+ IcsErr_MissSensorSubSubCatIndex,
/* Missing sub category: */
IcsErr_MissSubCat,
/* There is no Data defined: */
=====================================
libics_binary.c
=====================================
@@ -1,7 +1,7 @@
/*
* libics: Image Cytometry Standard file reading and writing.
*
- * Copyright 2015-2017:
+ * Copyright 2015-2017, 2022:
* Scientific Volume Imaging Holding B.V.
* Laapersveld 63, 1213 VB Hilversum, The Netherlands
* https://www.svi.nl
@@ -213,7 +213,7 @@ Ics_Error IcsCopyIds(const char *infilename,
error = IcsErr_FCopyIds;
goto exit;
}
- if (fseek(in, (long)inoffset, SEEK_SET) != 0) {
+ if (ICSFSEEK(in, (ptrdiff_t)inoffset, SEEK_SET) != 0) {
error = IcsErr_FCopyIds;
goto exit;
}
@@ -423,7 +423,7 @@ Ics_Error IcsOpenIds(Ics_Header *icsStruct)
br->dataFilePtr = IcsFOpen(filename, "rb");
if (br->dataFilePtr == NULL) return IcsErr_FOpenIds;
- if (fseek(br->dataFilePtr, (long)offset, SEEK_SET) != 0) {
+ if (ICSFSEEK(br->dataFilePtr, (ptrdiff_t)offset, SEEK_SET) != 0) {
fclose(br->dataFilePtr);
free(br);
return IcsErr_FReadIds;
@@ -524,13 +524,13 @@ Ics_Error IcsReadIdsBlock(Ics_Header *icsStruct,
Ics_Error IcsSkipIdsBlock(Ics_Header *icsStruct,
size_t n)
{
- return IcsSetIdsBlock (icsStruct, (long)n, SEEK_CUR);
+ return IcsSetIdsBlock (icsStruct, (ptrdiff_t)n, SEEK_CUR);
}
/* Sets the file pointer into the IDS file. */
Ics_Error IcsSetIdsBlock(Ics_Header *icsStruct,
- long offset,
+ ptrdiff_t offset,
int whence)
{
ICSINIT;
@@ -542,7 +542,7 @@ Ics_Error IcsSetIdsBlock(Ics_Header *icsStruct,
switch (whence) {
case SEEK_SET:
case SEEK_CUR:
- if (fseek(br->dataFilePtr, (long)offset, whence) != 0) {
+ if (ICSFSEEK(br->dataFilePtr, offset, whence) != 0) {
if (ferror(br->dataFilePtr)) {
error = IcsErr_FReadIds;
} else {
=====================================
libics_gzip.c
=====================================
@@ -1,7 +1,7 @@
/*
* libics: Image Cytometry Standard file reading and writing.
*
- * Copyright 2015-2017:
+ * Copyright 2015-2017, 2022:
* Scientific Volume Imaging Holding B.V.
* Laapersveld 63, 1213 VB Hilversum, The Netherlands
* https://www.svi.nl
@@ -407,13 +407,13 @@ Ics_Error IcsOpenZip(Ics_Header *icsStruct)
flags = getc(file);
if ((method != Z_DEFLATED) || ((flags & RESERVED) != 0))
return IcsErr_CorruptedStream;
- fseek(file, 6, SEEK_CUR); /* Discard time, xflags and OS code: */
+ ICSFSEEK(file, 6, SEEK_CUR); /* Discard time, xflags and OS code: */
if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
size_t len;
len = (uInt)getc(file);
len += ((uInt)getc(file)) << 8;
if (feof (file)) return IcsErr_CorruptedStream;
- fseek(file, (long)len, SEEK_CUR);
+ ICSFSEEK(file, (ptrdiff_t)len, SEEK_CUR);
}
if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
int c;
@@ -424,7 +424,7 @@ Ics_Error IcsOpenZip(Ics_Header *icsStruct)
while (((c = getc(file)) != 0) && (c != EOF));
}
if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
- fseek(file, 2, SEEK_CUR);
+ ICSFSEEK(file, 2, SEEK_CUR);
}
if (feof(file) || ferror(file)) return IcsErr_CorruptedStream;
@@ -544,7 +544,7 @@ Ics_Error IcsReadZipBlock(Ics_Header *icsStruct,
} while (err != Z_STREAM_END && todo > 0);
/* Set the file pointer back so that unused input can be read again. */
- fseek(file, -(int)stream->avail_in, SEEK_CUR);
+ ICSFSEEK(file, -(ptrdiff_t)stream->avail_in, SEEK_CUR);
if (err == Z_STREAM_END) {
/* All the data has been decompressed: Check CRC and original data
@@ -578,7 +578,7 @@ Ics_Error IcsReadZipBlock(Ics_Header *icsStruct,
/* Skip ZIP compressed data block. This function mostly does:
gzseek((gzFile)br->ZlibStream, (z_off_t)offset, whence); */
Ics_Error IcsSetZipBlock(Ics_Header *icsStruct,
- long offset,
+ ptrdiff_t offset,
int whence)
{
#ifdef ICS_ZLIB
@@ -589,7 +589,7 @@ Ics_Error IcsSetZipBlock(Ics_Header *icsStruct,
z_stream* stream = (z_stream*)br->zlibStream;
if ((whence == SEEK_CUR) && (offset<0)) {
- offset += (long)stream->total_out;
+ offset += (ptrdiff_t)stream->total_out;
whence = SEEK_SET;
}
if (whence == SEEK_SET) {
@@ -601,7 +601,7 @@ Ics_Error IcsSetZipBlock(Ics_Header *icsStruct,
if (offset==0) return IcsErr_Ok;
}
- bufsize = (unsigned int)(offset < ICS_BUF_SIZE ? offset : ICS_BUF_SIZE);
+ bufsize = (size_t)(offset < ICS_BUF_SIZE ? offset : ICS_BUF_SIZE);
buf = malloc(bufsize);
if (buf == NULL) return IcsErr_Alloc;
=====================================
libics_intern.h
=====================================
@@ -1,7 +1,7 @@
/*
* libics: Image Cytometry Standard file reading and writing.
*
- * Copyright 2015-2019:
+ * Copyright 2015-2019, 2022:
* Scientific Volume Imaging Holding B.V.
* Laapersveld 63, 1213 VB Hilversum, The Netherlands
* https://www.svi.nl
@@ -306,7 +306,7 @@ Ics_Error IcsReadZipBlock(Ics_Header *IcsStruct,
size_t len);
Ics_Error IcsSetZipBlock(Ics_Header *IcsStruct,
- long offset,
+ ptrdiff_t offset,
int whence);
/* Reading COMPRESS-compressed data */
=====================================
libics_ll.h
=====================================
@@ -1,7 +1,7 @@
/*
* libics: Image Cytometry Standard file reading and writing.
*
- * Copyright 2015-2017:
+ * Copyright 2015-2017, 2022:
* Scientific Volume Imaging Holding B.V.
* Laapersveld 63, 1213 VB Hilversum, The Netherlands
* https://www.svi.nl
@@ -95,7 +95,7 @@ ICSEXPORT Ics_Error IcsSkipIdsBlock(Ics_Header *icsStruct,
/* Sets the file pointer into the image data on disk (fseek anywhere). */
ICSEXPORT Ics_Error IcsSetIdsBlock(Ics_Header *icsStruct,
- long offset,
+ ptrdiff_t offset,
int whence);
/* Reads image data from disk. */
=====================================
libics_read.c
=====================================
@@ -220,7 +220,7 @@ static Ics_Token getIcsToken(char *str,
/* Because some older ics versions have uncapitalized subsubcat
symbols (e.g. "channels" instead of the current "Channels"), do a
- case insenstive string comparison for backward compatiblity. */
+ case-insensitive string comparison for backward compatibility. */
if (str != NULL) {
for (i = 0; i < listSpec->entries; i++) {
if (ICSSTRCASECMP(listSpec->list[i].name, str) == 0) {
@@ -266,16 +266,14 @@ static Ics_Error getIcsCat(char *str,
idx1 = strchr(token, '[');
if (idx1) {
idx2 = strchr(idx1 + 1, '[');
- }
- if (idx1) {
/* Todo: Check that this line is indeed not
- //necessary. */
+ necessary. */
/* token[strlen(token) - 1] = '\0'; */
*idx1 = '\0';
*index1 = idx1 + 1;
- }
- if (idx2) {
- *index2 = idx2 + 1;
+ if (idx2) {
+ *index2 = idx2 + 1;
+ }
}
}
*subSubCat = getIcsToken(token, &G_SubSubCategories);
@@ -719,43 +717,58 @@ Ics_Error IcsReadIcs(Ics_Header *icsStruct,
break;
case ICSTOK_DETOFFSET:
while (ptr != NULL && i < ICS_MAX_LAMBDA) {
- detID = atoi(idx1);
- switch (idx2[0]) {
- case 'X':
- icsStruct->
- detectorOffset[i++][detID][0]
- = atof(ptr);
- break;
- case 'Y':
- icsStruct->
- detectorOffset[i++][detID][1]
- = atof(ptr);
- break;
- case 'Z':
- icsStruct->
- detectorOffset[i++][detID][2]
- = atof(ptr);
- break;
- default:
- break;
+ if (idx1 && idx2) {
+ detID = atoi(idx1);
+ switch (idx2[0]) {
+ case 'X':
+ icsStruct->
+ detectorOffset[i++][detID][0]
+ = atof(ptr);
+ break;
+ case 'Y':
+ icsStruct->
+ detectorOffset[i++][detID][1]
+ = atof(ptr);
+ break;
+ case 'Z':
+ icsStruct->
+ detectorOffset[i++][detID][2]
+ = atof(ptr);
+ break;
+ default:
+ break;
+ }
+ ptr = STRTOK(NULL, seps);
+ } else {
+ error = IcsErr_MissSensorSubSubCatIndex;
+ break;
}
- ptr = STRTOK(NULL, seps);
}
break;
case ICSTOK_DETSENS:
while (ptr != NULL && i < ICS_MAX_LAMBDA) {
- detID = atoi(idx1);
- icsStruct->detectorSensitivity[i++][detID]
- = atof(ptr);
- ptr = STRTOK(NULL, seps);
+ if (idx1) {
+ detID = atoi(idx1);
+ icsStruct->detectorSensitivity[i++][detID]
+ = atof(ptr);
+ ptr = STRTOK(NULL, seps);
+ } else {
+ error = IcsErr_MissSensorSubSubCatIndex;
+ break;
+ }
}
break;
case ICSTOK_DETRADIUS:
- /* This is a temporary fix to provide
- support for ics files with a non-vector
+ if (idx1) {
+ /* This supports ics files with a non-vector
detector radius. */
- /* Todo: Remove this in due time. */
- if (idx1 == NULL) {
+ while (ptr != NULL && i < ICS_MAX_LAMBDA) {
+ detID = atoi(idx1);
+ icsStruct->detectorRadius[i++][detID]
+ = atof(ptr);
+ ptr = STRTOK(NULL, seps);
+ }
+ } else {
printf("Using non-vector detRadius.\n");
if (ptr != NULL) {
printf("Filling vector with single "
@@ -769,13 +782,6 @@ Ics_Error IcsReadIcs(Ics_Header *icsStruct,
}
}
}
- break;
- }
- while (ptr != NULL && i < ICS_MAX_LAMBDA) {
- detID = atoi(idx1);
- icsStruct->detectorRadius[i++][detID]
- = atof(ptr);
- ptr = STRTOK(NULL, seps);
}
break;
case ICSTOK_DETSCALE:
@@ -825,23 +831,28 @@ Ics_Error IcsReadIcs(Ics_Header *icsStruct,
break;
case ICSTOK_SPIMPLANEPROPDIR:
while (ptr != NULL && i < ICS_MAX_LAMBDA) {
- switch (idx1[0]) {
- case 'X':
- icsStruct->spimPlanePropDir[i++][0]
- = atof(ptr);
- break;
- case 'Y':
- icsStruct->spimPlanePropDir[i++][1]
- = atof(ptr);
- break;
- case 'Z':
- icsStruct->spimPlanePropDir[i++][2]
- = atof(ptr);
- break;
- default:
- break;
+ if (idx1) {
+ switch (idx1[0]) {
+ case 'X':
+ icsStruct->spimPlanePropDir[i++][0]
+ = atof(ptr);
+ break;
+ case 'Y':
+ icsStruct->spimPlanePropDir[i++][1]
+ = atof(ptr);
+ break;
+ case 'Z':
+ icsStruct->spimPlanePropDir[i++][2]
+ = atof(ptr);
+ break;
+ default:
+ break;
+ }
+ ptr = STRTOK(NULL, seps);
+ } else {
+ error = IcsErr_MissSensorSubSubCatIndex;
+ break;
}
- ptr = STRTOK(NULL, seps);
}
break;
case ICSTOK_SPIMPLANECENTEROFF:
=====================================
libics_sensor.c
=====================================
@@ -751,7 +751,6 @@ Ics_Error IcsGetSensorParameterMatrix(const ICS *ics,
const double **values,
Ics_SensorState *state)
{
- int p;
if (channel < 0 || channel >= ics->sensorChannels) {
return IcsErr_NotValidAction;
}
=====================================
libics_top.c
=====================================
@@ -1222,9 +1222,6 @@ const char *IcsGetErrorText(Ics_Error error)
case IcsErr_EndOfStream:
msg = "Unexpected end of stream";
break;
- case IcsErr_FailWriteLine:
- msg = "Failed to write a line in .ics file";
- break;
case IcsErr_FCloseIcs:
msg = "File close error on .ics file";
break;
@@ -1256,8 +1253,8 @@ const char *IcsGetErrorText(Ics_Error error)
case IcsErr_FWriteIds:
msg = "File write error on .ids file";
break;
- case IcsErr_IllegalROI:
- msg = "The given ROI extends outside the image";
+ case IcsErr_FailWriteLine:
+ msg = "Failed to write a line in .ics file";
break;
case IcsErr_IllIcsToken:
msg = "Illegal ICS token detected";
@@ -1266,6 +1263,9 @@ const char *IcsGetErrorText(Ics_Error error)
msg = "A function parameter has a value that is not legal or does "
"not match with a value previously given";
break;
+ case IcsErr_IllegalROI:
+ msg = "The given ROI extends outside the image";
+ break;
case IcsErr_LineOverflow:
msg = "Line overflow in .ics file";
break;
@@ -1275,9 +1275,6 @@ const char *IcsGetErrorText(Ics_Error error)
case IcsErr_MissCat:
msg = "Missing main category";
break;
- case IcsErr_MissingData:
- msg = "There is no Data defined";
- break;
case IcsErr_MissLayoutSubCat:
msg = "Missing layout subcategory";
break;
@@ -1293,9 +1290,15 @@ const char *IcsGetErrorText(Ics_Error error)
case IcsErr_MissSensorSubSubCat:
msg = "Missing sensor subsubcategory";
break;
+ case IcsErr_MissSensorSubSubCatIndex:
+ msg = "Missing sensor subsubcategory index";
+ break;
case IcsErr_MissSubCat:
msg = "Missing sub category";
break;
+ case IcsErr_MissingData:
+ msg = "There is no Data defined";
+ break;
case IcsErr_NoLayout:
msg = "Layout parameters missing or not defined";
break;
@@ -1308,12 +1311,12 @@ const char *IcsGetErrorText(Ics_Error error)
case IcsErr_NotValidAction:
msg = "The function won't work on the ICS given";
break;
- case IcsErr_TooManyChans:
- msg = "Too many channels specified";
- break;
case IcsErr_TooManyDetectors:
msg = "Too many detectors specified";
break;
+ case IcsErr_TooManyChans:
+ msg = "Too many channels specified";
+ break;
case IcsErr_TooManyDims:
msg = "Data has too many dimensions";
break;
View it on GitLab: https://salsa.debian.org/med-team/libics/-/commit/caf647ea83a1063dc95a444875a35d08cceda0d2
--
View it on GitLab: https://salsa.debian.org/med-team/libics/-/commit/caf647ea83a1063dc95a444875a35d08cceda0d2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221129/974b49b4/attachment-0001.htm>
More information about the debian-med-commit
mailing list