1 TINA 5 README
4 email@example.com 20/4/2005
11 1) What is TINA?
12 1a) History
13 1b) Authors
14 1c) What does TINA stand for?
15 1d) How do I know it works?
16 2) Where do I get TINA?
17 3) How do I compile the libraries?
18 3a) Compatibility issues
19 3a.i) Backup Build System
20 3b) Widget sets
21 3c) Compiler warning messages
22 4) How do I compile the toolkits?
23 4a) Toolkits with different widget sets
24 5) How do I write my own TINA code?
25 5a) Writing new algorithmic functionality
26 5b) Porting old TINA 4 code to TINA 5
29 1) What is TINA?
33 TINA (TINA Is No Acronym) provides a set of libraries for machine vision and
34 image analysis research. It is written in C primarily for use on GNU/Linux
35 platforms, although it can also be compiled on MacOSX, Solaris, and (with some
36 effort) MS Windows. The code is split into two areas:
38 tina-libs: back-end code for memory management, image structure handling
41 tina-tools: high-level algorithms, interface etc.
43 Each of these areas contains a number of libraries with specific purposes:
47 file: input/output file handling
48 geometry: basic geometry functions
49 image: basic image processing functions
50 math: basic mathematical functions
51 medical: back-end functions for medical image analysis
52 sys: basic memory allocation functions
53 vision: back-end functions for machine vision
57 draw: basic display drawing
58 gphx: low-level interface to widget sets
59 wdgts: high-level interface to widget sets
60 tlbase: basic tools (image loading etc.)
61 tlvision: machine vision tools
62 tlmedical: medical tools.
64 In order to use TINA, you must download both the tina-libs and tina-tools areas
65 from our website, and compile both. This will produce a set of libraries in the
66 libs subdirectories of both tina-libs and tina-tools.
68 The TINA libraries can be used in one of two ways. They have been designed to
69 be highly modular, allowing users to strip out parts of the functionality to
70 use in their own code (under the terms of the licence). However, they also
71 include code for interfaces to the algorithms. This code is in the form of a
72 set of "tools", each of which appears as a window on the screen, and which
73 collect together related functionality applicable to a certain task (loading
74 single images, stereo image pairs, temporal sequences or medical image
75 volumes; stereo vision; medical image segmentation; registration; blood flow
76 analysis etc. etc. ). In order to use this interface, you must build a
77 "toolkit", a program that includes the tools you want to access.
79 TINA is research software, continuously updated by a small group of core
80 programmers at the University of Manchester, primarily for their own
81 use. There is no "stable" release as such: the code in both the CVS repository
82 and the tarballs is the latest version. However, it is written with numerical
83 stability and statistical validity in mind, and all new additions are
84 thoroughly tested.
87 1a) History
91 Development of the original X11 based versions of TINA started in 1989 at the
92 Artificial Intelligence & Vision Research Unit (AIVRU) at the University of
93 Sheffield (www.shef.ac.uk). It was designed using experience gained in two
94 previous versions with an aim to minimise the process of software maintenance
95 and maximise code reuse. Later versions of TINA were developed there and also
96 at the Electronic Engineering Department of the University of Sheffield. TINA
97 became Open Source whilst being maintained by Electronic Engineering. Since
98 1997 TINA maintenance has been switched to Imaging Science and Biomedical
99 Engineering (ISBE) (www.isbe.man.ac.uk) at the University of Manchester
102 Until 2002 TINA was never explicitly funded as a project in its own
103 right. Rather it has been developed under numerous research grants and
104 collaborations as a framework to facilitate an ongoing co-ordinated research
105 effort into artificial vision. TINA was originally conceived by AIVRU
106 researcher Stephen Pollard as a library of functions necessary for
107 stereo-based 3D machine vision. John Porrill and Neil Thacker where also
108 involved at these early stages. After this team broke up Neil Thacker
109 continued vision research within TINA at Electronic Engineering, and together
110 with Tony Lacey released TINA as Open Source. In 1997 both Neil Thacker and
111 Tony Lacey moved to ISBE, from where TINA is now maintained. Tony left for a
112 career in industry in 2004: today, Neil Thacker is the project leader for
113 TINA, and Paul Bromiley performs most of the day-to-day maintenance of the
114 code and website.
117 1b) Authors
121 Along the way a large number of people have contributed to TINA both at the
122 University of Sheffield and the University of Manchester. Their contributions
123 are never forgotten (and their code never lost). A full list can be found at
127 1c) What does TINA stand for?
131 Originally the acronym TINA stood for "there is no alternative", which was
132 true at the time. Since then, several alternative meanings have been
133 suggested ("Thacker is not acceptable", "TINA is nearly accurate" etc.: most
134 of these were the result of a bad day at work). Today however, in a similar
135 style to acronym GNU, TINA stands for "TINA is no acronym". All previous
136 definitions have now been superseded!
139 1d) How do I know it works?
143 For most software, the question of accuracy is non-existent: your word
144 processor either lets you prepare and print a document, or does not. However,
145 for scientific software the question becomes more problematic because the
146 requirements are more extensive. The results of any machine vision algorithm
147 will be dependent on the statistical validity and numerical stability (or what
148 might be called the "theoretical" and "implementation" aspects) of the
149 algorithm, and any failure to meet these two goals might not be obvious to the
150 user without extensive validation work. Any attempt to justify the algorithms
151 used in TINA here would be largely pointless, since such justification can
152 only be meaningful after a suitable "negotiation of trust". Therefore, I will
153 commence that process with three simple observations:
155 a) All of the algorithms in TINA have been derived strictly within a context
156 of statistical validity: you won't find any active contour methods with
157 arbitrary image potential terms here! Therefore, the results of any algorithm
158 can be linked directly to the probability theoretic interpretation of the data
159 generation process. This is not a guarantee that a specific algorithm will
160 work for your data. However, it is a guarantee that, if your data obeys the
161 underlying statistical assumptions relevant to the algorithm (as specified in
162 our published papers: see point b), the interpretation of the data provided by
163 the algorithm will be valid. In theory, your results can be linked directly
164 all the way back to the underlying axioms of mathematics.
166 b) All of the algorithms in TINA have been used in our scientific research,
167 and thus subjected to peer-review in conference and journal publications. We
168 make preprints of these publications available via our website at
169 www.tina-vision.net/docs/memos.php. These papers contain details of our
170 in-house validation work.
172 c) All of the algorithms in TINA are available as open-source software.
173 Through a combination of reading the memos, documentation, and code, you can
174 see exactly how a given algorithm works. This facility is rarely afforded to
175 users of commercial machine vision or medical image analysis software. If you
176 think you have spotted a mistake in our work, get in touch! You will either
177 gain (admittedly limited) fame as an external contributor named on the TINA
178 website, or a very lengthy tutorial on statistics (e.g. if you mention the
179 words "Bayes Theory" within earshot of one of the core programmers).
182 2) Where do I get TINA?
186 The tina-libs and tina-tools code can be downloaded from our website
187 (www.tina-vision.net), either in the form of tarballs, or from the CVS
188 repository. Go to the website and click on the "software" link. Then, either
189 download the two tarballs or use the CVS instructions given there.
193 Create a directory in /usr/local called "Tina5", and download both tarballs to
194 this directory. Then unzip (using gunzip tarball_name) and untar (using tar
195 -xvf tarball_name) both tarballs: this will create the two directories
196 tina-libs and tina-tools in the /usr/local/Tina5 directory
200 Create a directory in /usr/local called "Tina5", then from within this
201 directory follow the instructions given on the website for anonymous access to
202 the CVS repository.
204 At the end of this step, you should have two directories, called tina-libs and
205 tina-tools, in the /usr/local/Tina5 directory.
208 3) How do I compile the libraries?
212 Before you start, you must have
214 autoconf 2.54 (or later)
215 automake 1.6.3 (or later)
216 libtool 1.4.2 (or later)
218 installed on your system in order to build TINA: all reasonably recent Linux
219 distro's should install these by default.
221 The basic approach is to cd into tina-libs, then type
226 make install
228 Then cd into tina-tools, and do the same. If these steps complete without
229 errors, you should end up with the compiled libraries in
230 /usr/local/Tina5/tina-libs/libs and /usr/local/Tina5/tina-tools/libs.
232 The full set of options provided by configure can be seen using;
234 ./configure --help
236 There are currently no specific tina-libs options (as of version 5.0rc0).
238 There are a couple of other concerns though...
241 3a) Compatibility Issues
245 If the above instructions fail to work for your system, your first port of
246 call should be the WikiWiki page on our website. Go to www.tina-vision.net,
247 click on "wiki" in the menu, and then click on "Tina5CompileGuide". If your
248 system is listed, then it will provide work-arounds or full solutions for
249 known problems. If not, pipe the outputs of ./configure and make to files and
250 e-mail them to me (firstname.lastname@example.org) and I will do my best to help you
251 out. I would appreciate feedback on compilation for systems not listed on the
252 wiki page: it allows us to keep the instructions up-to-date.
255 3a.i) Backup Build System
259 As well as the main, automake and autoconf based build system, TINA has a
260 backup system of hand-written Makefiles (a legacy from the TINA4 days). In
261 extremis, this can be used to work around serious compatibility issues. It
262 still requires that you run autoconf, since it needs access to config.h, but
263 bypasses the automake-based makefiles entirely. Read the inline documentation
264 in Tina5/tina-libs/tina-simple-build.sh for further information.
267 3b) Widgets
271 The tina-tools area contains interface code, arranged as a set of "tools" that
272 collect together related functionality for solving particular tasks (loading
273 single images, stereo image pairs, temporal sequences or medical image
274 volumes; stereo vision; medical image segmentation; registration; blood flow
275 analysis etc. etc.). This interface code is dependent on external widget and
276 graphics libraries. The tina-tools area contains wrappers for these libraries
277 (in the wdgts and gphx libraries), and is currently capable of using five
278 different widget sets:
280 NULL: (NULL widgets and NULL graphics) for testing or wrapping TINA code for
281 use in other programs: provides no interface.
283 Tcl/Tk: pronounced "tickle-tk" (Tcl widgets and Tk graphics) for text-based
284 interfaces and client/server operation).
286 Xview: sometimes called openwindows, (Xv widgets and X11 graphics), which is
287 our usual mode of operation. However, the external xview libraries
288 themselves do not work on 64-bit systems.
290 Motif: (Xm widgets and X11 graphics): an early replacement for xview, written
291 at a point when it looked like xview would be deprecated. Xview was
292 revived due to popular demand, but it looks like the end of xview has
293 finally arrived with the jump to 64-bit systems.
295 Gdk/Gtk:stands for "the GIMP (Graphical Image Manipulation Program) toolkit",
296 since it was originally written exclusively for the GIMP, and is the
297 widget set of choice for modern linux software. It is anticipated that
298 this will become the default for TINA in the next few years, with the
299 motif widgets as a backup for older systems, and xview deprecated. Two
300 versions of Gtk (1.2 and 2.0) are currently in use: TINA compiles with
301 1.2, but there are a few issues with 2.0. We are working on fixing
302 this (by the time you read this, there may be experimental GTK 2
303 widgets in a directory next to the existing GTK 1.2 widgets).
305 At the library compilation stage, you can compile as many of these as you
306 want. NULL widgets and graphics are always compiled. If you want a graphical
307 interface to TINA, you must compile at least one of xview, Motif or Gtk.
309 In order to compile the TINA widgets and graphics libraries you want to use,
310 you must ensure that the external libraries they depend on are installed. A
311 complete list of such packages for SuSE 9.2 is:
313 For gtk1.2 and gtk2
337 For motif:
345 For xview:
352 To get the textsw package (optional for xview):
356 Version numbers may be different for your own distro.
358 Then, at the stage when you type ./configure in the tina-tools area, the
359 last part of the output will be a list of which external widget libraries
360 autoconf was able to find. This search is run by m4 scripts, and targets
361 particular locations, so may not find the external widget libraries.
362 Typical output will look like this:
364 >tinatool configuration complete for i686-pc-linux-gnu.
366 > Source directory: .
367 > Installation directory: /usr/local/Tina5/tina-tools
368 > C compiler: gcc
370 > tina-libs headers: /usr/local/Tina5/tina-tools/../tina-libs
371 > tina-libs libraries: /usr/local/Tina5/tina-tools/../tina-libs/lib
373 > X11 headers: -I/usr/X11R6/include
374 > X11 libraries: -L/usr/X11R6/lib
376 > GTK flags: -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2
377 > -I/usr/lib/glib/include -I/usr/X11R6/include
378 > GTK libraries: -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk
379 > -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
381 > Xview headers: -I/usr/openwin/include
382 > Xview libraries: -L/usr/openwin/lib -lxview -lolgx
384 > Motif headers:
385 > Motif libraries: -lXm -lXp -lXext
387 > Tcl (>= Version 8) NOT FOUND Warning
389 > Configuration successful! Now type 'make' to build the libraries and then
390 > 'make install' to install the libraries into the prefix location.
392 In this example, the X11, xview and Gtk libraries and includes are
393 found. The Motif lines show that the libraries are found but not the
394 headers: watch out for this situation, as it means that the Motif widgets
395 will not be compiled. The Tcl libraries and headers are not found at all,
396 and so again will not be compiled.
398 If the external widget libraries you want to use are not found, and you
399 know that they are installed on your system (this will probably be the case
400 for 64 bit systems) then you have to specify the location on the ./configure
401 line. Possible arguments are (these should be typed on one line: they have
402 been split up here for clarity):
405 --with-gtk-prefix= (location of the gtk installation)
406 --with-motif-includes= (location of the motif headers)
407 --with-motif-libraries= (location of the motif libraries)
408 --with-tcl= (location of the tcl installation)
409 --with-tk= (location of the tk installation)
410 --with-xview-includes= (location of the xview headers)
411 --with-xview-libraries= (location of the xview libraries)
413 You can find these by browsing through the inlined documentation in the m4
414 scripts (in tina-tools/m4). Typical locations on a 64-bit system will be:
425 They may be different on your machine. The two xview lines are the lib64 and
426 include directories in the openwin directory (search for openwin). The motif
427 paths can be found by searching for Xm.h. The Tcl and Tk paths can be found
428 by searching for tclconfig.sh and tkconfig.sh. The gtk prefix can be found
429 by searching for gtkConfig.sh
431 Add these to the configure line, and check the report: as long as full paths
432 are given for both the includes and headers for the widgets and graphics you
433 want to compile, you will be OK. Then "make" and "make install": now you
434 should find that the tina-tools/lib directory contains libraries called e.g.
435 libtinatoolGphxGdk.a and libtinatoolWdgtsGtk.a (for gtk widgets and gdk
439 3c) Compiler warning messages
443 When you compile TINA you will notice a large number of compiler warnings.
444 They are the legacy of the 20-year development history of TINA: old coding
445 practices that are now considered unacceptable. One example is the
446 assumption that a pointer and an integer occupy the same amount of memory:
447 this is true on 32-bit systems, but not in general on 64-bit systems.
448 We are currently fixing these warnings: however, none of them have been
449 found to affect the algorithmic functionality.
452 4) How do I compile the toolkits?
456 At the end of step 3 you should have built the TINA libraries in both
457 tina-libs and tina-tools. The algorithmic functionality they provide could,
458 in theory, be used in your own code. However, 99% of users will want to use
459 the interface included with the libraries. These interfaces are called
460 "toolkits", and must be built independently of the libraries. Three examples
461 are included in the Tina5/toolkits area: they are called example, example2,
462 and mri_analysis.
464 The toolkit of interest to most users will be example2: this includes all
465 tools available at the time of writing i.e. all of the TINA functionality.
466 If you don't intend to do any programming, this is the one you should build.
467 Automatic building and installation is not included (yet) for historical
468 reasons: out scientific users expect to be able to build the libraries
469 independently, and so toolkit building must be performed after the library
470 build. To build this toolkit, follow the instructions below. You can then
471 make a link to the example2 executable in /usr/local/bin, allowing you to
472 run tinaTool from the command line. An icon is included in the example2
473 directory, should you wish to set up a desktop icon.
475 To compile one of the example toolkits, cd into example, example2, or
476 mri_analysis, and type make: this will build the tinaTool program, which you
477 can then run. The example toolkit is very basic, but can be used as a
478 starting point for building your own toolkit. The example2 toolkit include
479 all available TINA functionality. The mri_analysis toolkit contains the basic
480 medical images analysis functions: download the MRI image sequences from the
481 image library on our website, read the TINA 5 User's Guide (also on the
482 website) to find out how the tools work, and start experimenting with the
485 Since TINA is research software, it has been designed to allow users to build
486 their own toolkit for their current project, including only the tools
487 required. Most users will therefore eventually want to write their own
488 toolkit. This is relatively simple: you just have to copy one of the example
489 toolkits to a project area (e.g. /home/my_user_name/my_tina_project), open
490 tinaTool.c in an editor, and add a button for the tool you want to main(), and
491 a button procedure function to call the tool. For example, if you wanted to
492 access the coreg tool, you would add a button to main() using:
494 tw_button("Coreg", coreg_tool_proc, NULL);
496 and then the button procedure coreg_tool_proc anywhere above main
498 static void coreg_tool_proc()
500 coreg_tool(250, 250);
503 Finally, you have to add the header files that contain the prototypes for the
504 tools you want to include. Prototypes for all tool functions are contained in
506 #include <tinatool/tlbase/tlbaseDef.h>
507 #include <tinatool/tlbase/tlbasePro.h>
509 for the basic tools (input/output etc),
511 #include <tinatool/tlbase/tlvisDef.h>
512 #include <tinatool/tlbase/tlvisPro.h>
514 for the machine vision tools, and
516 #include <tinatool/tlbase/tlmedDef.h>
517 #include <tinatool/tlbase/tlmedPro.h>
519 for the medical image analysis tools. Since the coregistration tool is in the
520 medical tools library, you would add the last two lines to the top of your
521 tinaTool.c file (alongside the other header file include statements), or you
522 could just add all six. The TINA Users guide on the website
523 (www.tina-vision.net/software.php) contains a complete list of available
526 After building and running tinaTool, you will see a new button in the main
527 tool called "coreg". Pressing this calls the button procedure, which in turn
528 calls the coreg_tool function from the libraries.
531 4a) Toolkits with different widget sets
535 In order to compile toolkits with various widget sets, I recommend that you
536 use a simple Makefile. The example2 toolkit directory in tina-tools/example
537 contains an example: it allows you to switch simply between the different
538 available widget sets, although you have to set some paths here by hand. The
539 Makefile is called Makefile_tina: rename it to Makefile (after backing-up the
540 existing Makefile) to begin this process.
542 In general, a simple Tina5 makefile should look something like the following
543 (the filename should be "Makefile"):
546 # Makefile for Tina5
549 TINALIBS = -ltinaMedical -ltinaVision -ltinaImage -ltinaFile -ltinaGeom
550 -ltinaMath -ltinaSys
551 TINATOOLLIBS = -ltinatoolTlMed -ltinatoolTlvision -ltinatoolTlBase
552 -ltinatoolDraw -ltinatoolWdgtsGtk -ltinatoolGphxGdk
553 XLIBS = -lgtk -lgdk
554 SYSLIBS = -lm
555 CFLAGS = -g -pipe -DHAVE_CONFIG_H -DOWTOOLKIT_WARNING_DISABLED
556 INCLUDES = -I./ -I/usr/local/Tina5/tina-tools
557 -I/usr/local/Tina5/tina-libs -I/usr/openwin/include
558 LDFLAGS = -L/usr/local/Tina5/tina-libs/lib -L/usr/local/Tina5/tina-tools/lib
559 $(TINATOOLLIBS) $(TINALIBS) -L/opt/gnome/lib $(XLIBS) $(SYSLIBS)
560 OFILES =
563 gcc $(CFLAGS) $(INCLUDES) -c -o $@ $*.c
565 tinaTool: tinaTool.o $(OFILES)
566 gcc -o $@ $(CFLAGS) tinaTool.o $(OFILES) $(LDFLAGS)
568 # ---------
569 # Household
570 # ---------
572 clean :
573 \rm *.o
576 There are eight lines that set up various locations. TINALIBS and TINATOOLS
577 list the libraries to be included from the tina-liabs and tina-tools lib
578 directories. These must be in order, and the only changes you should need
579 to make to the above are to the Wdgts and Gphx libraries: these choose the
580 widget set you will use, and there are three possible combinations of interest
581 to the majority of users:
583 -ltinatoolWdgtsXm -ltinatoolGphxX11 : Motif widgets
584 -ltinatoolWdgtsXv -ltinatoolGphxX11 : Xview widgets
585 -ltinatoolWdgtsGtk -ltinatoolGphxGdk : Gtk widgets
587 The XLIBS line selects the external widget set libraries used: again there are
588 three possible selections:
590 XLIBS = -lXm -lX11 : Motif widgets
591 XLIBS = -lxview -lolgx -lX11 : Xview widgets
592 XLIBS = -lgtk -lgdk : Gtk widgets
594 I always call this line XLIBS, although it should be named for the libraries
595 you want to install.
597 The CFLAGS line passes arguments to the compiler: for most Linux systems, only
598 the first is of interest: -g adds debugging information, making your executable
599 larger, but providing the information necessary for using GDB or DDD for
600 debugging. Add -0, -02 or -03 for various levels of optimisation, making the
601 executable run faster, but making debugging more difficult.
603 Finally, the INCLUDES and LDFLAGS lines set paths for the libraries you have
604 specified above. These should look something like:
606 INCLUDES = -I./ -I/usr/local/Tina5/tina-tools -I/usr/local/Tina5/tina-libs
608 LDFLAGS = -L/usr/local/Tina5/tina-libs/lib -L/usr/local/Tina5/tina-tools/lib
609 $(TINATOOLLIBS) $(TINALIBS) -L/usr/include/gtk-1.2 $(XLIBS) $(SYSLIBS)
611 for gtk,
613 INCLUDES = -I./ -I/usr/local/Tina5/tina-tools -I/usr/local/Tina5/tina-libs
615 LDFLAGS = -L/usr/local/Tina5/tina-libs/lib -L/usr/local/Tina5/tina-tools/lib
616 $(TINATOOLLIBS) $(TINALIBS) -L/usr/openwin/lib -L/usr/X11/lib $(XLIBS)
619 for xview, and
621 INCLUDES = -I./ -I/usr/local/Tina5/tina-tools -I/usr/local/Tina5/tina-libs
623 LDFLAGS = -L/usr/local/Tina5/tina-libs/lib -L/usr/local/Tina5/tina-tools/lib
624 $(TINATOOLLIBS) $(TINALIBS) -L/usr/X11/lib $(XLIBS) $(SYSLIBS)
626 for Motif.
628 The library and include locations will have to be set for your machine, but
629 should be fairly standard. Just two points to be aware of: the locations will
630 be .../lib64 rather than .../lib on 64-bit systems, and notice that you refer
631 to libraries in shorthand, so libxview.so becomes lxview (suffix stripped,
632 and l replacing lib).
634 The OFILES line refers to object files you wish to compile. If you are
635 compiling one of the example toolkits i.e. the only .c file in the current
636 directory is tinaTool.c, then leave it empty. If you start writing or adapting
637 your own Tina code (see below) and have a directory with other c files in it,
638 add my_c_file.o to this line for every my_c_file.c you want to compile.
640 Finally, type "make" in the directory containing the tinaTool.c file and the
641 Makefile: if all goes well, you should end up with a "tinaTool" executable that
642 you can run.
645 5) How do I write my own TINA code?
649 TINA provides the ideal environment for machine vision or medical image
650 analysis researchers to develop their own code. All of the basic functionality
651 (memory allocation, image representation, basic image processing, geometry,
652 maths etc. etc.) is already present, allowing for rapid code development. In
653 addition, the long development history has resulted in highly stable code.
656 5a) Writing new algorithmic functionality
660 In order to start developing new algorithmic functionality, set up a project
661 area with a simple Makefile and a tinaTool.c file (you can use the example
662 one provided in the tina-tools area). Then, there are two possible options:
663 writing new files, or adapting those already present in the libraries.
665 If you are adapting files from the libraries, copy the C files plus their
666 file-level H files to your project area. Then build a copy of the header
667 file directory structure in your project area: put the inctw script
668 in your project area, and run it. The script can be found in the
669 tina-tools/toolkits/example2 directory. This sets up a copy of the
670 header directory system, and soft-links from the relevant directories to the
671 header files in your project area, ensuring that when you compile TINA it
672 links in the local header files in place of the ones in the libraries. Then
673 you can get on with your coding: remember to add prototypes to your project
674 area header files if you add new functions.
676 Secondly, if you are writing new C files, you can just work in a project area
677 as usual: the libraries won't be linking to your code, so the header file
678 system doesn't affect you. However, if in the future you will be putting
679 your code back into the libraries, you should think about where it would go
680 and divide up your code accordingly.
684 5b) Porting old TINA 4 code to TINA 5
688 Several major changes were made to the TINA libraries in the move from
689 version 4 to version 5. In particular, we have a new header file system, and
690 a new version of the sequence tool. The header file structure for TINA4 was
691 a complete mess (and one of the common criticisms of TINA), so everyone ended
692 up including tina_all.h and thus completely bypassing the whole point of header
693 files. Therefore, we have put a formal structure in place, which makes the
694 code much cleaner, easier to write, and easier to understand.
696 The code is divided into three layers: library, group, and file. For example,
697 the function coreg_auto (which performs coregistration) is in the file
698 tlmedCoreg_auto.c, so the group is tlmedCoreg (the group for coregistration
699 functions) and the library is tlmed (the library for medical functions).
700 The tl tells you that it is in the tina-tools area, rather than tina-libs.
701 Every C file has its own H file for prototypes of all non-static functions in
702 that C file. The file level H file must be in the same directory as its C
703 file. Other C files in the same group should include that "file level" H file
704 when needed. Every group has its own "group level" header files: in this
705 example tlmed_CoregPro.h and tlmed_coregDef.h. The Pro file includes all of
706 the file level H files for that group, and the Def file contains all
707 definitions (structures etc) for that group. C files in other groups should
708 include the group level header files when needed. Finally, there are library
709 level header files tlmedPro.h and tlmedDef.h: these include all of the group
710 level Pro and Def files for that library. C files in other libraries should
711 include the library-level header files when needed. Finally, the whole of
712 TINA is split into the tina-tools, which is front end and algorithmic code,
713 and tina-libs, which is lower-level code (memory allocation, handling
714 structures etc.). It may seem a bit complicated, but when you get used to it
715 this system allows you to know immediately which H files you should be
716 including in your own C files, making coding much faster without the need for
717 a tina-all.h file.
719 The changes in terms of locations of functions are mostly limited to the
720 sequence tool: some functions (such as get_seq_ptr) have changed their names.
721 The easiest way to port your code is to put it into a project area, strip out
722 all include statements, and compile. Then, start the lxr code browser web
723 page, and search for each function that generates "function not defined"
724 errors: once you know which C file the function is in, you can work out which
725 H file to include. These will be only library-level header files if you
726 never intend to put your code back into the libraries.
728 Finally, if there are any functions whose names have changed, search through
729 the libraries that correspond to the relevant area in TINA4. For example, if
730 you are including get_seq_ptr, you know it comes from the sequence tool:
731 search the sequence tool code (group tlbaseSeq for the tina-tools level stuff
732 and imgSeq for the tina-libs level stuff) for a function that does the same
733 job (in this case get_seq_ptr). It seems long-winded at first, but don't
734 despair: after a couple of hours of this, you can do it from memory without
735 using the code browser.
This page was automatically generated by the
Visit the LXR main site for more