1 /* ----------------------------- MNI Header -----------------------------------
2 @NAME       : nd_loop.h
3 @DESCRIPTION: Header file for nd_loop.c
4 @METHOD     : Use these routines in the following way:
5 
6    Set start, end and increment vectors to define looping;
7 
8    nd_begin_looping(start, current, ndims);
9    while (!nd_end_of_loop(current, end, ndims)) {
10       nd_update_current_count(current, increment, end,
11                               current_count, ndims);
12 
13       Use current and current_count to work on hyperslab;
14 
15       nd_increment_loop(current, start, increment, end, ndims);
16    }
17 
18 @GLOBALS    :
19 @CREATED    : December 2, 1994 (Peter Neelin)
20 @MODIFIED   :
21  * $Log: nd_loop.h,v $
22  * Revision 6.2  2004-10-15 13:47:13  bert
23  * Minor changes for Windows compatibility
24  *
25  * Revision 6.1  2002/01/14 21:28:26  neelin
26  * Moved nd_loop, voxel_loop, ParseArgv and time_stamp from ../progs/Proglib
27  * in order to include them in the main minc library.
28  *
29  * Revision 6.1  1999/10/19 14:45:14  neelin
30  * Fixed Log subsitutions for CVS
31  *
32  * Revision 6.0  1997/09/12 13:23:41  neelin
33  * Release of minc version 0.6
34  *
35  * Revision 5.0  1997/08/21  13:24:41  neelin
36  * Release of minc version 0.5
37  *
38  * Revision 4.0  1997/05/07  20:00:50  neelin
39  * Release of minc version 0.4
40  *
41  * Revision 3.0  1995/05/15  19:31:35  neelin
42  * Release of minc version 0.3
43  *
44  * Revision 1.3  1994/12/02  09:40:37  neelin
45  * Fixed arguments to nd_end_of_loop.
46  *
47  * Revision 1.2  94/12/02  09:20:17  neelin
48  * Added comments to clarify use of routines.
49  *
50  * Revision 1.1  94/12/02  08:40:31  neelin
51  * Initial revision
52  *
53 @COPYRIGHT  :
54               Copyright 1994 Peter Neelin, McConnell Brain Imaging Centre,
55               Montreal Neurological Institute, McGill University.
56               Permission to use, copy, modify, and distribute this
57               software and its documentation for any purpose and without
58               fee is hereby granted, provided that the above copyright
59               notice appear in all copies.  The author and McGill University
60               make no representations about the suitability of this
61               software for any purpose.  It is provided "as is" without
62               express or implied warranty.
63 ---------------------------------------------------------------------------- */
64 
65 #include "minc.h"
66 
67 #if defined(__cplusplus)
68 extern "C" {
69 #endif
70 
71 MNCAPI void nd_begin_looping(long start[], long current[], int ndims);
72 MNCAPI int nd_end_of_loop(long current[], long end[], int ndims);
73 MNCAPI void nd_update_current_count(long current[],
74                                     long increment[], long end[],
75                                     long current_count[],
76                                     int ndims);
77 MNCAPI void nd_increment_loop(long current[],
78                               long start[], long increment[], long end[],
79                               int ndims);
80 
81 #if defined(__cplusplus)
82 }
83 #endif
84