~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina5/tina-tools/tinatool/tlbase/tlbaseSeq_draw.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**********
  2  * 
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  * 
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/tlbase/tlbaseSeq_draw.c,v $
 37  * Date    :  $Date: 2003/10/01 16:02:47 $
 38  * Version :  $Revision: 1.3 $
 39  * CVS Id  :  $Id: tlbaseSeq_draw.c,v 1.3 2003/10/01 16:02:47 tony Exp $
 40  *
 41  * Author  :  Legacy TINA
 42  *
 43  * Notes :    mjs modified to bring in line with new sequence tool 21/2/03
 44  *
 45  *********
 46 */
 47 
 48 #include "tlbaseSeq_draw.h"
 49 
 50 #if HAVE_CONFIG_H
 51 #include <config.h>
 52 #endif
 53 
 54 
 55 #include <stdio.h>
 56 #include <sys/param.h>
 57 #include <string.h>   
 58 
 59 
 60 #include <tina/sys/sysDef.h>
 61 #include <tina/sys/sysPro.h>
 62 #include <tina/math/mathDef.h>  
 63 #include <tina/math/mathPro.h>
 64 #include <tina/image/imgDef.h>
 65 #include <tina/image/imgPro.h>
 66 
 67 #include <tinatool/draw/drawDef.h>
 68 #include <tinatool/draw/drawPro.h>
 69 
 70 #include <tinatool/tlbase/tlbaseSeq_roitool.h>
 71 
 72 static Vec3 map(Vec2 p, double *z)
 73 {
 74   return (vec3(vec2_x(p), vec2_y(p), *z));
 75 }
 76 
 77 void str2_draw3(Tv * tv, Tstring * string, double z)
 78 {
 79   draw3_str2(tv, string, map, &z);
 80   printf("drawn string\n");
 81 }
 82 
 83 
 84 int seq_z_get(void)
 85 {
 86   Br_imstack *ims = Br_imstack_get();
 87 
 88   if (ims == NULL)
 89     return -1;
 90      else
 91        return ims->z;
 92 }
 93 
 94 /*
 95   Set z-coordinate of 3D-cursor, see seq_z_get.
 96   working slice.
 97 */
 98 void seq_z_set(int newz)
 99 {
100 
101   Br_imstack *ims = Br_imstack_get();
102   if (ims != NULL)
103     {
104       newz = MAX(newz, ims->lz);
105       newz = MIN(newz, ims->uz - 1);
106       ims->z = newz;
107     }
108 }
109 
110 
111 /*
112   Get active VOI number.
113 */
114 int seq_nvoi_get()
115 {
116   Br_imstack *ims = Br_imstack_get();
117   if (ims == NULL)
118     return(-1);
119   return(ims->nvoi);
120 }
121 
122 /*
123   Set active VOI number (< NVOI in splines.h).
124 */
125 /*void seq_nvoi_set(int nvoi)
126 {
127   if (ims == NULL)
128     return;
129   ims->nvoi = nvoi;
130 }
131 */
132 
133 Tstring *seq_string_get(void)
134 {
135   Br_imstack *ims = Br_imstack_get();
136   if (ims == NULL)
137     return NULL;
138   else
139     return svoi_string_get(VOI(ims));
140 }
141 
142 /*
143   Get lowest slice number in image stack (inclusive bound).
144 */
145 int seq_lz_get(void)
146 {
147   Br_imstack *ims = Br_imstack_get();
148   if (ims == NULL)
149     return -1;
150   else
151     return ims->lz;
152 }
153 
154 /*
155   Get highest slice number+1 in image stack (exclusive bound).
156 */
157 int seq_uz_get(void)
158 {
159   Br_imstack *ims = Br_imstack_get();
160   if (ims == NULL)
161     return -1;
162   else
163     return ims->uz;
164 }
165 
166 void seq_voi_empty(void)
167 {
168   Br_imstack *ims = Br_imstack_get();
169   if (ims != NULL)
170     svoi_empty(VOI(ims));
171 }
172 
173 
174 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.