|
From: <kin...@us...> - 2025-08-15 16:43:56
|
Revision: 7272
http://sourceforge.net/p/teem/code/7272
Author: kindlmann
Date: 2025-08-15 16:43:53 +0000 (Fri, 15 Aug 2025)
Log Message:
-----------
added unu built for a simple-to-parse display of the info that nrrdSanity prints (but now nrrdSanity is no longer part of what CMake builds)
Modified Paths:
--------------
teem/trunk/src/unrrdu/CMakeLists.txt
teem/trunk/src/unrrdu/GNUmakefile
teem/trunk/src/unrrdu/privateUnrrdu.h
Added Paths:
-----------
teem/trunk/src/unrrdu/built.c
Modified: teem/trunk/src/unrrdu/CMakeLists.txt
===================================================================
--- teem/trunk/src/unrrdu/CMakeLists.txt 2025-08-15 16:42:31 UTC (rev 7271)
+++ teem/trunk/src/unrrdu/CMakeLists.txt 2025-08-15 16:43:53 UTC (rev 7272)
@@ -9,6 +9,7 @@
3op.c
affine.c
about.c
+ built.c
axdelete.c
axinfo.c
basinfo.c
Modified: teem/trunk/src/unrrdu/GNUmakefile
===================================================================
--- teem/trunk/src/unrrdu/GNUmakefile 2025-08-15 16:42:31 UTC (rev 7271)
+++ teem/trunk/src/unrrdu/GNUmakefile 2025-08-15 16:43:53 UTC (rev 7272)
@@ -61,7 +61,7 @@
ccsettle.o about.o axsplit.o axmerge.o mlut.o mrmap.o tile.o untile.o \
unorient.o env.o dist.o affine.o i2w.o w2i.o fft.o acrop.o dering.o \
diff.o cksum.o dnorm.o vidicon.o undos.o uncmt.o basinfo.o grid.o ilk.o \
- ninspect.o hack.o aabplot.o block.o unblock.o
+ ninspect.o hack.o aabplot.o block.o unblock.o built.o
####
####
####
Added: teem/trunk/src/unrrdu/built.c
===================================================================
--- teem/trunk/src/unrrdu/built.c (rev 0)
+++ teem/trunk/src/unrrdu/built.c 2025-08-15 16:43:53 UTC (rev 7272)
@@ -0,0 +1,85 @@
+/*
+ Teem: Tools to process and visualize scientific data and images
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
+
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
+
+ This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along with
+ this library; if not, write to Free Software Foundation, Inc., 51 Franklin Street,
+ Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "unrrdu.h"
+#include "privateUnrrdu.h"
+
+#define INFO "Configuration and platform parameters of this \"unu\""
+static const char *_unrrdu_builtInfoL
+ = (INFO ". Not every configuration/compilation choice made when building Teem "
+ " matters for nrrd and the other libraries that \"unu\" depends on; "
+ "see output of \"XXXX HEY WUT? XXXX\" for a view of those. "
+ "This documents things visible to \"unu\".");
+
+static int
+unrrdu_builtMain(int argc, const char **argv, const char *me, hestParm *hparm) {
+ airArray *mop;
+ char *err;
+ int pret, all, enc, form;
+ hestOpt *opt = NULL;
+
+ AIR_UNUSED(argc);
+ AIR_UNUSED(argv);
+ AIR_UNUSED(me);
+ hestOptAdd_Flag(&opt, "a", &all,
+ "list all known info, not just the encoding "
+ "and formats supported by nrrd");
+ hparm->noArgsIsNoProblem = AIR_TRUE;
+
+ mop = airMopNew();
+ USAGE_OR_PARSE(_unrrdu_builtInfoL);
+ airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways);
+
+ /*
+ Much of the below is based on teem/src/bin/nrrdSanity.c
+ That program starts by running nrrdSanity, but there's no reason to do that here,
+ because teem/src/bin/unu.c itself runs nrrdSanityOrDie()
+ */
+ printf("# nrrd file data encodings:\n");
+ for (enc = nrrdEncodingTypeUnknown + 1; enc < nrrdEncodingTypeLast; enc++) {
+ int avail = nrrdEncodingArray[enc]->available();
+ printf("%c encoding %s %s available\n", avail ? '+' : '-',
+ airEnumStr(nrrdEncodingType, enc), avail ? "YES is" : "NO not");
+ }
+ printf("# file formats handled by nrrd library:\n");
+ for (form = nrrdFormatTypeUnknown + 1; form < nrrdFormatTypeLast; form++) {
+ int avail = nrrdFormatArray[form]->available();
+ printf("%c format %s %s available\n", avail ? '+' : '-',
+ airEnumStr(nrrdFormatType, form), avail ? "YES is" : "NO not");
+ }
+ if (all) {
+ printf("# optional libraries:\n");
+ printf("%c library fftw %s available\n", nrrdFFTWEnabled ? '+' : '-',
+ nrrdFFTWEnabled ? "YES is" : "NO not");
+ printf("%c library pthread %s available\n", airThreadCapable ? '+' : '-',
+ airThreadCapable ? "YES is" : "NO not");
+ /* NOT shown: status of Levmar */
+ printf("# platform parameters:\n");
+ printf("%u = sizeof(void*)\n", (unsigned int)sizeof(void *));
+ printf("%u = airMyQNaNHiBit\n", airMyQNaNHiBit);
+ printf("%s = airMyEndian()\n", airEnumStr(airEndian, airMyEndian()));
+ }
+
+ airMopOkay(mop);
+ return 0;
+}
+
+UNRRDU_CMD(built, INFO);
Modified: teem/trunk/src/unrrdu/privateUnrrdu.h
===================================================================
--- teem/trunk/src/unrrdu/privateUnrrdu.h 2025-08-15 16:42:31 UTC (rev 7271)
+++ teem/trunk/src/unrrdu/privateUnrrdu.h 2025-08-15 16:43:53 UTC (rev 7272)
@@ -73,6 +73,7 @@
#define UNRRDU_LIST(C) &unrrdu_##C##Cmd,
#define UNRRDU_MAP(F) \
F(about) \
+ F(built) \
F(env) \
F(i2w) \
F(w2i) \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|