1 /*
2   Teem: Tools to process and visualize scientific data and images             .
3   Copyright (C) 2012, 2011, 2010, 2009  University of Chicago
4   Copyright (C) 2008, 2007, 2006, 2005  Gordon Kindlmann
5   Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998  University of Utah
6 
7   This library is free software; you can redistribute it and/or
8   modify it under the terms of the GNU Lesser General Public License
9   (LGPL) as published by the Free Software Foundation; either
10   version 2.1 of the License, or (at your option) any later version.
11   The terms of redistributing and/or modifying this software also
12   include exceptions to the LGPL that facilitate static linking.
13 
14   This library is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   Lesser General Public License for more details.
18 
19   You should have received a copy of the GNU Lesser General Public License
20   along with this library; if not, write to Free Software Foundation, Inc.,
21   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 */
23 
24 #include "ten.h"
25 #include "privateTen.h"
26 
27 #define INFO "Information about this program and its use"
28 
29 int
tend_aboutMain(int argc,const char ** argv,const char * me,hestParm * hparm)30 tend_aboutMain(int argc, const char **argv, const char *me,
31                hestParm *hparm) {
32   char buff[AIR_STRLEN_MED], fmt[AIR_STRLEN_MED];
33   char par1[] = "\t\t\t\t"
34     "\"tend\" is a command-line interface to much of the functionality "
35     "in \"ten\", a C library for diffusion image processing. Ten is one "
36     "library in the \"Teem\" collection of libraries.  More information "
37     "about Teem is at <http://teem.sf.net>. A checkout of Teem source "
38     "is available via:\n "
39     "svn co http://teem.svn.sf.net/svnroot/teem/teem/trunk teem\n ";
40   char par2[] = "\t\t\t\t"
41     "Long-term maintenance of this software depends on funding, and "
42     "funding depends on being able to document who is using it for what.  "
43     "If tend or Ten has helped in your research, including for simple one-off "
44     "experiments or mundane data hacking, the developers of Teem would love "
45     "to know. There are multiple ways of communicating this.  "
46     "In your publications, consider adding a line such as this "
47     "in the Acknowledgments: "
48     "\"Data processing performed with the tend tool, "
49     "part of the Teem toolkit available at "
50     "http://teem.sf.net\". "
51     "Alternatively, please email glk@uchicago.edu and briefly describe "
52     "how Teem software has helped in your work. "
53     "Please also consider joining the teem-users mailing list: "
54     "<http://lists.sourceforge.net/lists/listinfo/teem-users>. This is "
55     "the primary forum for feedback, questions, and feature requests.\n ";
56   char par3[] = "\t\t\t\t"
57     "Like \"unu\", another Teem command-line binary, it is often useful "
58     "to chain together invocations of tend with pipes, as in the "
59     "following, which estimates tensors from DWIs, takes a slice of the "
60     "tensor volume, computes the standard RGB colormap of the principal "
61     "eigenvector, and then quantizes it to an 8-bit PNG:\n";
62   char par4[] = "\ttend estim -i dwi.nhdr -B kvp -knownB0 true \\\n "
63     "  | tend slice -a 2 -p 30 \\\n "
64     "  | tend evecrgb -c 0 -a cl2 -gam 1.2 \\\n "
65     "  | unu quantize -b 8 -min 0 -max 1 -o z30-rgb.png\n";
66 
67   AIR_UNUSED(argc);
68   AIR_UNUSED(argv);
69   AIR_UNUSED(me);
70 
71   fprintf(stdout, "\n");
72   sprintf(buff, "--- %s ---", tendTitle);
73   sprintf(fmt, "%%%ds\n",
74           (int)((hparm->columns-strlen(buff))/2 + strlen(buff) - 1));
75   fprintf(stdout, fmt, buff);
76   sprintf(buff, "(Teem version %s, %s)",
77           airTeemVersion, airTeemReleaseDate);
78   sprintf(fmt, "%%%ds\n",
79           (int)((hparm->columns-strlen(buff))/2 + strlen(buff) - 1));
80   fprintf(stdout, fmt, buff);
81   fprintf(stdout, "\n");
82 
83   _hestPrintStr(stdout, 1, 0, 78, par1, AIR_FALSE);
84   _hestPrintStr(stdout, 1, 0, 78, par2, AIR_FALSE);
85   _hestPrintStr(stdout, 1, 0, 78, par3, AIR_FALSE);
86   _hestPrintStr(stdout, 2, 0, 78, par4, AIR_FALSE);
87 
88   return 0;
89 }
90 
91 TEND_CMD(about, INFO);
92