Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkIpPic.h
Go to the documentation of this file.
1 /*============================================================================
2 
3  Copyright (c) German Cancer Research Center (DKFZ)
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are met:
8 
9  - Redistributions of source code must retain the above copyright notice, this
10  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  - All advertising materials mentioning features or use of this software must
17  display the following acknowledgement:
18 
19  "This product includes software developed by the German Cancer Research
20  Center (DKFZ)."
21 
22  - Neither the name of the German Cancer Research Center (DKFZ) nor the names
23  of its contributors may be used to endorse or promote products derived from
24  this software without specific prior written permission.
25 
26  THIS SOFTWARE IS PROVIDED BY THE GERMAN CANCER RESEARCH CENTER (DKFZ) AND
27  CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
28  BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GERMAN
30  CANCER RESEARCH CENTER (DKFZ) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
37  DAMAGE.
38 
39 ============================================================================*/
40 
44 /*
45  * $RCSfile$
46  *--------------------------------------------------------------------
47  * DESCRIPTION
48  * public defines for the pic-format
49  *
50  * $Log$
51  * Revision 1.3 2007/03/22 13:41:29 nolden
52  * FIX: resolve problems with chili plugin
53  *
54  * Revision 1.2 2007/03/07 17:23:18 nolden
55  * fixes for chili plugin build
56  *
57  * Revision 1.1 2006/12/13 11:54:43 nolden
58  * *** empty log message ***
59  *
60  * Revision 1.47 2006/11/20 16:09:18 nolden
61  * FIX/CHG: different mangling of zlib names for ITK 3.x
62  *
63  * Revision 1.46 2006/09/20 11:38:17 nolden
64  * CHG: use itk zlib header from itkzlib subdir of ipPic if USE_ITKZLIB is defined
65  *
66  * Revision 1.45 2006/04/20 12:56:00 nolden
67  * FIX/CHG/ENH: added PPC-Mac definitions
68  *
69  * Revision 1.44 2005/10/11 19:06:41 ivo
70  * FIX: typo
71  *
72  * Revision 1.43 2005/10/11 18:35:34 ivo
73  * FIX: typo
74  *
75  * Revision 1.42 2005/10/11 18:19:46 ivo
76  * ENH: trying to fix zlib problems: use renamed itk zlib methods (itk_gzread etc)
77  *
78  * Revision 1.41 2005/04/29 15:41:46 ivo
79  * FIX: qchili compatibility for version of 21/4/05
80  *
81  * Revision 1.40 2004/04/06 14:59:39 nolden
82  * moved win32 compatibility settings from mitkIpPic.h to ipPic.pro
83  *
84  * Revision 1.39 2004/03/25 18:35:05 andre
85  * bug fix
86  *
87  * Revision 1.38 2003/12/02 11:54:31 tobiask
88  * Added setters and getters for rgb pixels.
89  *
90  * Revision 1.37 2003/11/28 14:24:45 tobiask
91  * Fixed bugs in macros mitkIpPicGET_PIXEL and mitkIpPicPUT_PIXEL.
92  *
93  * Revision 1.36 2003/09/30 20:12:50 tobiask
94  * Added macros for getting and setting pixel values.
95  *
96  * Revision 1.35 2003/02/18 12:28:23 andre
97  * write compressed pic files
98  *
99  * Revision 1.34 2002/11/13 17:52:59 ivo
100  * new ipPic added.
101  *
102  * Revision 1.32 2002/10/31 10:00:30 ivo
103  * zlib.lib including headers now in win32. gz-extension should work now on every windows.
104  * WIN32 define changed to standard _WIN32.
105  *
106  * Revision 1.31 2002/05/16 13:14:30 peter
107  * changed include path to ipPic/mitkIpPic.h
108  *
109  * Revision 1.30 2002/04/18 19:09:13 ivo
110  * compression (zlib) activated.
111  *
112  * Revision 1.1.1.1 2002/04/18 18:38:43 ivo
113  * no message
114  *
115  * Revision 1.29 2002/02/27 08:54:43 andre
116  * zlib changes
117  *
118  * Revision 1.28 2000/06/26 16:02:05 andre
119  * pPicFORALL_x bug fix
120  *
121  * Revision 1.27 2000/05/24 14:10:51 tobiask
122  * Removed ipPic/ from the include directives.
123  *
124  * Revision 1.26 2000/05/04 12:52:35 ivo
125  * inserted BSD style license
126  *
127  * Revision 1.25 2000/05/04 12:35:58 ivo
128  * some doxygen comments.
129  *
130  * Revision 1.24 1999/12/09 19:17:46 andre
131  * *** empty log message ***
132  *
133  * Revision 1.23 1999/12/09 19:11:51 andre
134  * *** empty log message ***
135  *
136  * Revision 1.22 1999/11/29 09:41:39 andre
137  * *** empty log message ***
138  *
139  * Revision 1.21 1999/11/29 09:34:34 andre
140  * *** empty log message ***
141  *
142  * Revision 1.20 1999/11/28 16:29:43 andre
143  * *** empty log message ***
144  *
145  * Revision 1.19 1999/11/28 16:27:21 andre
146  * *** empty log message ***
147  *
148  * Revision 1.18 1999/11/27 23:59:45 andre
149  * *** empty log message ***
150  *
151  * Revision 1.17 1999/11/27 19:15:08 andre
152  * *** empty log message ***
153  *
154  * Revision 1.16 1999/11/27 12:47:52 andre
155  * *** empty log message ***
156  *
157  * Revision 1.15 1999/08/20 08:25:42 andre
158  * *** empty log message ***
159  *
160  * Revision 1.14 1998/09/16 18:35:16 andre
161  * *** empty log message ***
162  *
163  * Revision 1.13 1998/09/16 18:32:53 andre
164  * *** empty log message ***
165  *
166  * Revision 1.12 1998/07/16 12:33:18 andre
167  * *** empty log message ***
168  *
169  * Revision 1.11 1998/07/14 11:16:16 andre
170  * *** empty log message ***
171  *
172  * Revision 1.10 1998/06/23 15:56:40 andre
173  * *** empty log message ***
174  *
175  * Revision 1.9 1998/06/18 09:12:14 andre
176  * *** empty log message ***
177  *
178  * Revision 1.8 1998/06/09 12:38:30 andre
179  * added mitkIpPicDelSubTag
180  *
181  * Revision 1.7 1998/06/09 11:34:32 andre
182  * *** empty log message ***
183  *
184  * Revision 1.6 1998/06/09 10:58:25 andre
185  * added mitkIpPicAddSubTag
186  *
187  * Revision 1.5 1998/05/09 18:30:23 andre
188  * *** empty log message ***
189  *
190  * Revision 1.4 1998/05/06 14:13:15 andre
191  * added info->pixel_start_in_file
192  *
193  * Revision 1.3 1997/10/20 13:35:40 andre
194  * *** empty log message ***
195  *
196  * Revision 1.2 1997/09/15 10:24:12 andre
197  * mitkIpPicPut now returns status
198  *
199  * Revision 0.2 1993/04/02 16:18:39 andre
200  * now works on PC, SUN and DECstation
201  *
202  * Revision 0.1 1993/03/31 11:44:35 andre
203  * added 'GetSlice'
204  *
205  * Revision 0.0 1993/03/26 12:56:26 andre
206  * Initial revision
207  *
208  *
209  *--------------------------------------------------------------------
210  *
211  */
212 
213 #define USE_ITKZLIB
214 
215 #ifndef _mitkIpPic_h
216 #define _mitkIpPic_h
217 
218 
219 #ifndef NO_DEBUG
220 # define mitkIpPicDEBUG
221 #endif
222 
223 
224 #include <stdlib.h>
225 #include <stdio.h>
226 #include <string.h>
227 
228 #ifdef sun
229 # include <unistd.h>
230 #endif
231 
232 
233 
234 #ifdef WIN
235 # include <windows.h>
236 extern DWORD ipWinFread(LPSTR ptr, DWORD size, DWORD n, FILE *stream);
237 #endif
238 
239 
240 
241 #include <assert.h>
242 
243 #include <mitkIpTypes.h>
244 
245 
246 #ifdef mitkIpPicDEBUG
247 #endif
248 
249 
250 /*
251 ** defines
252 */
253 #define mitkIpPicVERSION "PIC VERSION 3.00 "
254 #define mitkIpPicVERSIONe "PIC VERSION 3.00e "
255 #define _mitkIpPicNDIM 8
256 #define _mitkIpPicTAGLEN 32
257 
258 
259 #if (THIS_IS_BIG_ENDIAN) || defined (_IBMR2) || (mc68000) || (sun) || (__convex__) || (__hppa) || (_MIPSEB) || defined ( __PPC__)
260 # define _mitkIpENDIAN_IS_BIG
261 #else
262 # define _mitkIpENDIAN_IS_LITTLE
263 #endif
264 
265 
266 #define mitkIpPicVersionMajor(pic) (mitkIpUInt1_t)(pic->info->version[12] - '0')
267 #define mitkIpPicVersionMinor(pic) (mitkIpUInt1_t)(10 * (pic->info->version[14]-'0' ) \
268  + pic->info->version[15]-'0')
269 #define mitkIpPicEncryptionType(pic) (pic->info->version[16])
270 
271 /*#define mitkIpPicIsPic(pic) (( (pic)->magic == mitkIpPicPicDescriptor_m) \
272  ? mitkIpTrue : mitkIpFalse )*/
273 
274 
275 #define mitkIpPicDR(type,len) (mitkIpUInt4_t)( ((type)<<16) + (len) )
276 
277 #define mitkIpPicFOR_TYPE( _ipPIC_TYPE, _ipPIC_CMD, _ipPIC_PIC) \
278  _ipPIC_CMD(_ipPIC_TYPE,_ipPIC_PIC)
279 
280 #define mitkIpPicFORALL( _ipPIC_CMD, _ipPIC_PIC ) \
281  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
282  { \
283  case mitkIpPicDR( mitkIpPicInt, 8 ): \
284  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC); \
285  break; \
286  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
287  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC); \
288  break; \
289  case mitkIpPicDR( mitkIpPicInt, 16 ): \
290  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC); \
291  break; \
292  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
293  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC); \
294  break; \
295  case mitkIpPicDR( mitkIpPicInt, 32 ): \
296  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC); \
297  break; \
298  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
299  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC); \
300  break; \
301  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
302  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC); \
303  break; \
304  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
305  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC); \
306  break; \
307  default: \
308  fprintf( stderr, \
309  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
310  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
311  break; \
312  }
313 
314 #define mitkIpPicFORALL_1( _ipPIC_CMD, _ipPIC_PIC, A1 ) \
315  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
316  { \
317  case mitkIpPicDR( mitkIpPicInt, 8 ): \
318  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1); \
319  break; \
320  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
321  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1); \
322  break; \
323  case mitkIpPicDR( mitkIpPicInt, 16 ): \
324  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1); \
325  break; \
326  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
327  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1); \
328  break; \
329  case mitkIpPicDR( mitkIpPicInt, 32 ): \
330  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1); \
331  break; \
332  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
333  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1); \
334  break; \
335  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
336  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1); \
337  break; \
338  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
339  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1); \
340  break; \
341  default: \
342  fprintf( stderr, \
343  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
344  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
345  break; \
346  }
347 
348 #define mitkIpPicFORALL_2( _ipPIC_CMD, _ipPIC_PIC, A1, A2 ) \
349  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
350  { \
351  case mitkIpPicDR( mitkIpPicInt, 8 ): \
352  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2); \
353  break; \
354  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
355  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2); \
356  break; \
357  case mitkIpPicDR( mitkIpPicInt, 16 ): \
358  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2); \
359  break; \
360  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
361  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2); \
362  break; \
363  case mitkIpPicDR( mitkIpPicInt, 32 ): \
364  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2); \
365  break; \
366  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
367  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2); \
368  break; \
369  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
370  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2); \
371  break; \
372  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
373  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2); \
374  break; \
375  default: \
376  fprintf( stderr, \
377  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
378  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
379  break; \
380  }
381 
382 #define mitkIpPicFORALL_3( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3 ) \
383  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
384  { \
385  case mitkIpPicDR( mitkIpPicInt, 8 ): \
386  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3); \
387  break; \
388  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
389  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3); \
390  break; \
391  case mitkIpPicDR( mitkIpPicInt, 16 ): \
392  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3); \
393  break; \
394  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
395  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3); \
396  break; \
397  case mitkIpPicDR( mitkIpPicInt, 32 ): \
398  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3); \
399  break; \
400  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
401  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3); \
402  break; \
403  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
404  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3); \
405  break; \
406  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
407  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3); \
408  break; \
409  default: \
410  fprintf( stderr, \
411  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
412  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
413  break; \
414  }
415 
416 #define mitkIpPicFORALL_4( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4 ) \
417  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
418  { \
419  case mitkIpPicDR( mitkIpPicInt, 8 ): \
420  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4); \
421  break; \
422  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
423  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4); \
424  break; \
425  case mitkIpPicDR( mitkIpPicInt, 16 ): \
426  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4); \
427  break; \
428  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
429  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4); \
430  break; \
431  case mitkIpPicDR( mitkIpPicInt, 32 ): \
432  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4); \
433  break; \
434  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
435  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4); \
436  break; \
437  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
438  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4); \
439  break; \
440  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
441  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4); \
442  break; \
443  default: \
444  fprintf( stderr, \
445  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
446  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
447  break; \
448  }
449 
450 #define mitkIpPicFORALL_5( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4, A5 ) \
451  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
452  { \
453  case mitkIpPicDR( mitkIpPicInt, 8 ): \
454  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
455  break; \
456  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
457  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
458  break; \
459  case mitkIpPicDR( mitkIpPicInt, 16 ): \
460  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
461  break; \
462  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
463  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
464  break; \
465  case mitkIpPicDR( mitkIpPicInt, 32 ): \
466  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
467  break; \
468  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
469  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
470  break; \
471  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
472  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
473  break; \
474  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
475  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
476  break; \
477  default: \
478  fprintf( stderr, \
479  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
480  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
481  break; \
482  }
483 
484 #define mitkIpPicFORALL_6( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4, A5, A6 ) \
485  switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
486  { \
487  case mitkIpPicDR( mitkIpPicInt, 8 ): \
488  _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
489  break; \
490  case mitkIpPicDR( mitkIpPicUInt, 8 ): \
491  _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
492  break; \
493  case mitkIpPicDR( mitkIpPicInt, 16 ): \
494  _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
495  break; \
496  case mitkIpPicDR( mitkIpPicUInt, 16 ): \
497  _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
498  break; \
499  case mitkIpPicDR( mitkIpPicInt, 32 ): \
500  _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
501  break; \
502  case mitkIpPicDR( mitkIpPicUInt, 32 ): \
503  _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
504  break; \
505  case mitkIpPicDR( mitkIpPicFloat, 32 ): \
506  _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
507  break; \
508  case mitkIpPicDR( mitkIpPicFloat, 64 ): \
509  _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
510  break; \
511  default: \
512  fprintf( stderr, \
513  "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
514  __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
515  break; \
516  }
517 
518 #define _mitkIpPicGET_PIXEL(TYPE,PIC,X,Y,RESULT) \
519 { \
520  TYPE* data = (TYPE *) (PIC)->data \
521  + (X) + (Y) * (PIC)->n[0]; \
522  RESULT = *data; \
523 }
524 
525 #define _mitkIpPicPUT_PIXEL(TYPE,PIC,X,Y,VALUE) \
526 { \
527  TYPE* data = (TYPE *) (PIC)->data \
528  + (X) + (Y) * (PIC)->n[0]; \
529  *data = VALUE; \
530 }
531 
532 #define mitkIpPicGET_PIXEL(PIC,X,Y,RESULT) \
533 { \
534  mitkIpPicFORALL_3(_mitkIpPicGET_PIXEL,PIC,X,Y,RESULT); \
535 }
536 
537 #define mitkIpPicPUT_PIXEL(PIC,X,Y,RESULT) \
538 { \
539  mitkIpPicFORALL_3(_mitkIpPicPUT_PIXEL,PIC,X,Y,RESULT); \
540 }
541 
542 #define _mitkIpPicGET_PIXEL_RGB(TYPE,PIC,X,Y,R,G,B) \
543 { \
544  mitkIpUInt4_t skip = (PIC)->n[0] * (PIC)->n[1]; \
545  TYPE* data = (TYPE *) (PIC)->data + (X) + (Y) * (PIC)->n[0]; \
546  R = *(data); \
547  G = *(data + skip); \
548  B = *(data + skip + skip); \
549 }
550 
551 #define _mitkIpPicPUT_PIXEL_RGB(TYPE,PIC,X,Y,R,G,B) \
552 { \
553  mitkIpUInt4_t skip = (PIC)->n[0] * (PIC)->n[1]; \
554  TYPE* data = (TYPE *) (PIC)->data + (X) + (Y) * (PIC)->n[0]; \
555  *data = (R); \
556  *(data + skip) = (G); \
557  *(data + skip + skip) = (B); \
558 }
559 
560 #define mitkIpPicGET_PIXEL_RGB(PIC,X,Y,R,G,B) \
561 { \
562  mitkIpPicFORALL_5(_mitkIpPicGET_PIXEL_RGB,PIC,X,Y,R,G,B); \
563 }
564 
565 #define mitkIpPicPUT_PIXEL_RGB(PIC,X,Y,R,G,B) \
566 { \
567  mitkIpPicFORALL_5(_mitkIpPicPUT_PIXEL_RGB,PIC,X,Y,R,G,B); \
568 }
569 
570 #define USE_ZLIB
571 #ifdef USE_ZLIB
572 #ifdef USE_ITKZLIB
573 # define mitkIpPicFile_t gzFile
574 # define mitkIpPicFOpen gzopen
575 # define mitkIpPicFTell gztell
576 # define mitkIpPicFSeek gzseek
577 # define mitkIpPicFRead(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
578 # define mitkIpPicFWrite _mitkIpPicFWrite
579 # define mitkIpPicFEOF gzeof
580 # define mitkIpPicFClose gzclose
581 # include "itk_zlib.h"
582 #else
583 # define mitkIpPicFile_t gzFile
584 # define mitkIpPicFOpen gzopen
585 # define mitkIpPicFTell gztell
586 # define mitkIpPicFSeek gzseek
587 # define mitkIpPicFRead(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
588 # define mitkIpPicFWrite _mitkIpPicFWrite
589 # define mitkIpPicFEOF gzeof
590 # define mitkIpPicFClose gzclose
591 # include <zlib.h>
592 #endif
593 #else
594 # define mitkIpPicFile_t FILE *
595 # define mitkIpPicFOpen fopen
596 # define mitkIpPicFTell ftell
597 # define mitkIpPicFSeek fseek
598 # define mitkIpPicFRead fread
599 # define mitkIpPicFWrite fwrite
600 # define mitkIpPicFEOF feof
601 # define mitkIpPicFClose fclose
602 #endif
603 
604 
605 #ifdef _mitkIpENDIAN_IS_LITTLE
606 # define mitkIpPicFReadLE mitkIpPicFRead
607 # define mitkIpPicFReadBE mitkIpPicFReadCvt
608 #else
609 # define mitkIpPicFReadLE mitkIpPicFReadCvt
610 # define mitkIpPicFReadBE mitkIpPicFRead
611 #endif
612 
613 #ifdef _mitkIpENDIAN_IS_LITTLE
614 # define mitkIpPicFWriteLE mitkIpPicFWrite
615 # define mitkIpPicFWriteBE mitkIpPicFWriteCvt
616 #else
617 # define mitkIpPicFWriteLE mitkIpPicFWriteCvt
618 # define mitkIpPicFWriteBE mitkIpPicFWrite
619 #endif
620 
621 
622 #ifdef _mitkIpENDIAN_IS_LITTLE
623 # define mitkIpFReadLE fread
624 # define mitkIpFReadBE mitkIpFReadCvt
625 #else
626 # define mitkIpFReadLE mitkIpFReadCvt
627 # define mitkIpFReadBE fread
628 #endif
629 
630 #ifdef _mitkIpENDIAN_IS_LITTLE
631 # define mitkIpFWriteLE fwrite
632 # define mitkIpFWriteBE mitkIpFWriteCvt
633 #else
634 # define mitkIpFWriteLE mitkIpFWriteCvt
635 # define mitkIpFWriteBE fwrite
636 #endif
637 
638 
639 #ifdef WIN
640 # undef mitkIpFReadLE
641 # define mitkIpFReadLE fread
642 #endif
643 
644 
645 
646 #ifdef _mitkIpENDIAN_IS_LITTLE
647 # define mitkIpCvtFromLE(data, len, bytes)
648 # define mitkIpCvtFromBE(data, len, bytes) _mitkIpCvtEndian( (data), (len), (bytes) )
649 #else
650 # define mitkIpCvtFromLE(data, len, bytes) _mitkIpCvtEndian( (data), (len), (bytes) )
651 # define mitkIpCvtFromBE(data, len, bytes)
652 #endif
653 
654 #ifdef _mitkIpENDIAN_IS_LITTLE
655 # define mitkIpCpFromLE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
656 # define mitkIpCpFromBE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
657 #else
658 # define mitkIpCpFromLE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
659 # define mitkIpCpFromBE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
660 #endif
661 
662 #ifdef _mitkIpENDIAN_IS_LITTLE
663 # define mitkIpCpToLE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
664 # define mitkIpCpToBE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
665 #else
666 # define mitkIpCpToLE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
667 # define mitkIpCpToBE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
668 #endif
669 
670 
671 #define mitkIpEndianSwap2(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00))
672 
673 #define mitkIpEndianSwap4(x) ((((x) >> 24) & 0x000000FF) | (((x) << 24) & 0xFF000000)) \
674  | ((((x) >> 8) & 0x0000FF00) | (((x) << 8) & 0x00FF0000))
675 
676 /*
677 ** NOTE: these macros *DO NOT* work for in-place transformations.
678 */
679 /*
680 ** maybe ipEndianSwap should be used
681 */
682 #ifdef _mitkIpENDIAN_IS_LITTLE
683 # define mitkIpInt2FromLE(from, to) *((mitkIpInt2_t *)(to)) = *((mitkIpInt2_t *)(from))
684 # define mitkIpInt4FromLE(from, to) *((mitkIpInt4_t *)(to)) = *((mitkIpInt4_t *)(from))
685 # define mitkIpUInt2FromLE(from, to) mitkIpInt2FromLE(from, to)
686 # define mitkIpUInt4FromLE(from, to) mitkIpInt4FromLE(from, to)
687 # define mitkIpFloat4FromLE(from, to) mitkIpInt4FromLE(from, to)
688 # define mitkIpFloat8FromLE(from, to) *((mitkIpFloat8_t *)(to)) = *((mitkIpFloat8_t *)(from))
689 #else
690 # define mitkIpInt2FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[1]; \
691  ((char *)(to))[1] = ((char *)(from))[0];
692 
693 # define mitkIpInt4FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[3]; \
694  ((char *)(to))[1] = ((char *)(from))[2]; \
695  ((char *)(to))[2] = ((char *)(from))[1]; \
696  ((char *)(to))[3] = ((char *)(from))[0];
697 # define mitkIpUInt2FromLE(from, to) mitkIpInt2FromLE(from, to)
698 # define mitkIpUInt4FromLE(from, to) mitkIpInt4FromLE(from, to)
699 # define mitkIpFloat4FromLE(from, to) mitkIpInt4FromLE(from, to)
700 # define mitkIpFloat8FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[7]; \
701  ((char *)(to))[1] = ((char *)(from))[6]; \
702  ((char *)(to))[2] = ((char *)(from))[5]; \
703  ((char *)(to))[3] = ((char *)(from))[4]; \
704  ((char *)(to))[4] = ((char *)(from))[3]; \
705  ((char *)(to))[5] = ((char *)(from))[2]; \
706  ((char *)(to))[6] = ((char *)(from))[1]; \
707  ((char *)(to))[7] = ((char *)(from))[0];
708 #endif /* _mitkIpENDIAN_IS_LITTLE */
709 
710 /*
711 ** NOTE: Most architectures are symmetrical with respect to conversions.
712 */
713 #define mitkIpInt2ToLE(from, to) mitkIpInt2FromLE(from, to)
714 #define mitkIpInt4ToLE(from, to) mitkIpInt4FromLE(from, to)
715 #define mitkIpUInt2ToLE(from, to) mitkIpUInt2FromLE(from, to)
716 #define mitkIpUInt4ToLE(from, to) mitkIpUInt4FromLE(from, to)
717 #define mitkIpFloat4ToLE(from, to) mitkIpFloat4FromLE(from, to)
718 #define mitkIpFloat8ToLE(from, to) mitkIpFloat8FromLE(from, to)
719 
720 
721 /*
722 ** types for the pic format
723 */
724 
726 
727 typedef enum
728  {
737  /* ---- add new types before this line !!! ----*/
738  /* ---- don't forget to add a new type also to mitkIpPicType.c !!! ----*/
740  } mitkIpPicType_t;
741 
742 /*
743 typedef enum
744  {
745  mitkIpPicUnknown_m = 0,
746  mitkIpPicDescriptor_m = 0xDDDD
747  } _mitkIpPicMagic_t;
748 */
749 
750 
751 typedef struct
752  {
753  char tag[_mitkIpPicTAGLEN+1]; /* name of this tag */
754  mitkIpPicType_t type; /* datatype of the value */
755  mitkIpUInt4_t bpe; /* bits per element */
756  mitkIpUInt4_t dim; /* number of dimensions */
757  mitkIpUInt4_t n[_mitkIpPicNDIM]; /* size of dimension n[i] */
758  void *value; /* the value */
759  } mitkIpPicTSV_t; /* Tag Structure Value */
760 
762  {
767 
768 typedef struct
769  {
774  struct mitkIpPicDescriptor *lender; /* lender of image data */
775  mitkIpUInt4_t borrower; /* borrower of image data */
776  mitkIpUInt4_t ref; /* reference counter */
778 
779 typedef struct mitkIpPicDescriptor
780  {
781  void *data; /* pointer to 'image' data */
782  _mitkIpPicInfo_t *info; /* pointer to the PicInfo structure */
783  mitkIpPicType_t type; /* datatype of the data */
784  mitkIpUInt4_t bpe; /* bits per element */
785  mitkIpUInt4_t dim; /* number of dimensions */
786  mitkIpUInt4_t n[_mitkIpPicNDIM]; /* size of dimension n[i] */
787 #ifdef WIN
788  HANDLE hdata;
789 #endif
791 
792 
793 #if defined(__cplusplus) || defined(c_plusplus)
794 extern "C" {
795 #endif
796 
797 extern _mitkIpEndian_t _mitkIpEndian( void );
798 
799 extern void _mitkIpCp( void *source, void *destination, unsigned long int len );
800 extern void _mitkIpCvtEndian( void *data, unsigned long int len, unsigned char bytes );
801 extern void _mitkIpCpCvtEndian( void *source, void *destination, unsigned long int len, unsigned char bytes );
802 
803 extern mitkIpPicFile_t _mitkIpPicOpenPicFileIn( const char *path );
804 extern int mitkIpPicAccess( const char *path, int mode );
805 extern int mitkIpPicRemoveFile( const char *path );
806 
809 
810 extern size_t mitkIpFReadCvt( void *ptr, size_t size, size_t nitems, FILE *stream );
811 extern size_t _mitkIpFWrite( void *ptr, size_t size, size_t nitems, FILE *stream );
812 
813 #define _mitkIpPicHAS_CAN_READ_COMPRESSED
815 extern size_t mitkIpPicFReadCvt( void *ptr, size_t size, size_t nitems, mitkIpPicFile_t stream );
816 
817 #define _mitkIpPicHAS_CAN_WRITE_COMPRESSED
819 extern size_t mitkIpPicFWriteCvt( void *ptr, size_t size, size_t nitems, mitkIpPicFile_t stream );
820 
821 extern mitkIpPicDescriptor *mitkIpPicNew( void );
822 extern void mitkIpPicClear( mitkIpPicDescriptor *pic );
823 extern void mitkIpPicFree( mitkIpPicDescriptor *pic );
824 
825 extern mitkIpUInt4_t _mitkIpPicSize(
826 #if defined(__cplusplus) || defined(c_plusplus)
827  const
828 #endif
829  mitkIpPicDescriptor *pic );
830 
831 extern mitkIpUInt4_t _mitkIpPicElements( mitkIpPicDescriptor *pic );
832 
833 extern mitkIpUInt4_t _mitkIpPicTSVSize( mitkIpPicTSV_t *tsv );
834 extern mitkIpUInt4_t _mitkIpPicTSVElements( mitkIpPicTSV_t *tsv );
835 
837 
838 extern mitkIpPicDescriptor *_mitkIpPicCopySlice( mitkIpPicDescriptor *pic, mitkIpPicDescriptor *pic_in, mitkIpUInt4_t slice );
839 
840 extern mitkIpPicDescriptor *_mitkIpPicOldGet( FILE *infile, mitkIpPicDescriptor *pic );
842 extern mitkIpPicDescriptor *_mitkIpPicOldGetSlice( FILE *infile, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice );
843 
844 
846 
847 extern mitkIpPicDescriptor *mitkIpPicGet( const char *picfile_name, mitkIpPicDescriptor *pic );
848 extern mitkIpPicDescriptor *mitkIpPicGetHeader( const char *picfile_name, mitkIpPicDescriptor *pic );
849 extern mitkIpPicDescriptor *mitkIpPicGetSlice( const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice );
850 
851 extern _mitkIpPicTagsElement_t *_mitkIpPicReadTags( _mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, FILE *stream, char encryption_type );
853 extern _mitkIpPicTagsElement_t *_mitkIpPicFindTag( _mitkIpPicTagsElement_t *head, const char *tag );
854 extern mitkIpUInt4_t _mitkIpPicTagsSize( _mitkIpPicTagsElement_t *head );
855 extern mitkIpUInt4_t _mitkIpPicTagsNumber( _mitkIpPicTagsElement_t *head );
856 extern void _mitkIpPicWriteTags( _mitkIpPicTagsElement_t *head, FILE *stream, char encryption_type );
857 extern void _mitkIpPicFreeTags( _mitkIpPicTagsElement_t *head );
860 
862 extern void mitkIpPicAddSubTag( mitkIpPicTSV_t *parent, mitkIpPicTSV_t *tsv );
863 extern mitkIpPicTSV_t * mitkIpPicDelTag( mitkIpPicDescriptor *pic, const char *tag );
864 extern mitkIpPicTSV_t * mitkIpPicDelSubTag( mitkIpPicTSV_t *parent, const char *tag );
865 extern mitkIpPicDescriptor *mitkIpPicGetTags( const char *picfile_name, mitkIpPicDescriptor *pic );
866 extern mitkIpPicTSV_t *mitkIpPicQueryTag( mitkIpPicDescriptor *pic, const char *t );
867 extern mitkIpPicTSV_t *mitkIpPicQuerySubTag( mitkIpPicTSV_t *parent, const char *t );
868 extern void mitkIpPicFreeTag( mitkIpPicTSV_t *tsv );
869 
870 
871 extern _mitkIpPicTagsElement_t * _mitkIpPicReadTagsMem( _mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, mitkIpUInt1_t **mem_ptr, char encryption_type );
872 extern mitkIpPicDescriptor *mitkIpPicGetMem( mitkIpUInt1_t *mem_pic );
873 extern void _mitkIpPicWriteTagsMem( _mitkIpPicTagsElement_t *head, mitkIpUInt1_t **mem_ptr );
874 extern mitkIpUInt1_t *mitkIpPicPutMem( mitkIpPicDescriptor *pic, int *mem_size );
875 
876 
877 extern int mitkIpPicPut( const char *picfile_name, mitkIpPicDescriptor *pic );
878 extern void mitkIpPicPutSlice( const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice );
879 
880 #define _mitkIpPicInfoNORMAL 0
881 #define _mitkIpPicInfoSHORT (1 << 0)
882 void _mitkIpPicInfo( FILE *stream, mitkIpPicDescriptor *pic, mitkIpUInt4_t flags );
883 void _mitkIpPicInfoPrintTags( FILE *stream, _mitkIpPicTagsElement_t* head, mitkIpUInt4_t level, mitkIpUInt4_t flags );
884 
885 extern const char *mitkIpPicTypeName( mitkIpUInt4_t type );
886 
887 #if defined(__cplusplus) || defined(c_plusplus)
888 }
889 #endif
890 
891 
892 #endif /* _mitkIpPic_h */
893 
894 #ifdef MITK_UNMANGLE_IPPIC
895 #include "mitkIpPicUnmangle.h"
896 #endif
void _mitkIpPicWriteTagsMem(_mitkIpPicTagsElement_t *head, mitkIpUInt1_t **mem_ptr)
mitkIpBool_t _mitkIpPicCanReadCompressed
mitkIpPicTSV_t * mitkIpPicQuerySubTag(mitkIpPicTSV_t *parent, const char *t)
mitkIpPicTag_t version
Definition: mitkIpPic.h:770
mitkIpUInt4_t _mitkIpPicTSVElements(mitkIpPicTSV_t *tsv)
mitkIpPicDescriptor * mitkIpPicGetHeader(const char *picfile_name, mitkIpPicDescriptor *pic)
void _mitkIpPicInfoPrintTags(FILE *stream, _mitkIpPicTagsElement_t *head, mitkIpUInt4_t level, mitkIpUInt4_t flags)
mitkIpPicTSV_t * mitkIpPicDelSubTag(mitkIpPicTSV_t *parent, const char *tag)
void _mitkIpCpCvtEndian(void *source, void *destination, unsigned long int len, unsigned char bytes)
struct mitkIpPicDescriptor mitkIpPicDescriptor
mitkIpPicType_t type
Definition: mitkIpPic.h:754
mitkIpUInt4_t borrower
Definition: mitkIpPic.h:775
void _mitkIpPicInfo(FILE *stream, mitkIpPicDescriptor *pic, mitkIpUInt4_t flags)
void _mitkIpCvtEndian(void *data, unsigned long int len, unsigned char bytes)
void mitkIpPicAddSubTag(mitkIpPicTSV_t *parent, mitkIpPicTSV_t *tsv)
struct _mitkIpPicTagsElement_s _mitkIpPicTagsElement_t
mitkIpPicDescriptor * mitkIpPicGetTags(const char *picfile_name, mitkIpPicDescriptor *pic)
_mitkIpPicInfo_t * info
Definition: mitkIpPic.h:782
int mitkIpPicPut(const char *picfile_name, mitkIpPicDescriptor *pic)
struct _mitkIpPicTagsElement_s * prev
Definition: mitkIpPic.h:764
_mitkIpPicTagsElement_t * _mitkIpPicFindTag(_mitkIpPicTagsElement_t *head, const char *tag)
mitkIpBool_t mitkIpPicSetWriteCompression(mitkIpBool_t compression)
struct _mitkIpPicTagsElement_s * next
Definition: mitkIpPic.h:765
mitkIpPicType_t
Definition: mitkIpPic.h:727
mitkIpUInt4_t _mitkIpPicTSVSize(mitkIpPicTSV_t *tsv)
const char * mitkIpPicTypeName(mitkIpUInt4_t type)
mitkIpUInt4_t dim
Definition: mitkIpPic.h:756
_mitkIpPicTagsElement_t * _mitkIpPicCloneTags(_mitkIpPicTagsElement_t *head)
struct mitkIpPicDescriptor * lender
Definition: mitkIpPic.h:774
mitkIpBool_t mitkIpPicGetWriteCompression(void)
void mitkIpPicAddTag(mitkIpPicDescriptor *pic, mitkIpPicTSV_t *tsv)
mitkIpUInt1_t * mitkIpPicPutMem(mitkIpPicDescriptor *pic, int *mem_size)
vcl_size_t _mitkIpFWrite(void *ptr, vcl_size_t size, vcl_size_t nitems, FILE *stream)
_mitkIpPicTagsElement_t * tags_head
Definition: mitkIpPic.h:771
mitkIpPicDescriptor * mitkIpPicGetSlice(const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
vcl_size_t mitkIpPicFReadCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, gzFile stream)
mitkIpPicTSV_t * _mitkIpPicCloneTag(mitkIpPicTSV_t *source)
mitkIpPicTSV_t * tsv
Definition: mitkIpPic.h:763
_mitkIpPicTagsElement_t * _mitkIpPicInsertTag(_mitkIpPicTagsElement_t *head, mitkIpPicTSV_t *tsv)
_mitkIpPicTagsElement_t * _mitkIpPicReadTagsMem(_mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, mitkIpUInt1_t **mem_ptr, char encryption_type)
mitkIpUInt4_t _mitkIpPicSize(mitkIpPicDescriptor *pic)
mitkIpBool_t
Definition: mitkIpTypes.h:80
void _mitkIpPicFreeTags(_mitkIpPicTagsElement_t *head)
#define _mitkIpPicNDIM
Definition: mitkIpPic.h:255
mitkIpPicType_t type
Definition: mitkIpPic.h:783
void mitkIpPicClear(mitkIpPicDescriptor *pic)
void mitkIpPicFree(mitkIpPicDescriptor *pic)
mitkIpUInt4_t _mitkIpPicTagsSize(_mitkIpPicTagsElement_t *head)
mitkIpPicDescriptor * mitkIpPicGet(const char *picfile_name, mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * _mitkIpPicOldGetHeader(FILE *infile, mitkIpPicDescriptor *pic)
mitkIpUInt4_t _mitkIpPicElements(mitkIpPicDescriptor *pic)
mitkIpUInt4_t bpe
Definition: mitkIpPic.h:755
void mitkIpPicPutSlice(const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
mitkIpUInt4_t ref
Definition: mitkIpPic.h:776
mitkIpPicDescriptor * _mitkIpPicOldGet(FILE *infile, mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * mitkIpPicGetMem(mitkIpUInt1_t *mem_pic)
void _mitkIpPicWriteTags(_mitkIpPicTagsElement_t *head, FILE *stream, char encryption_type)
vcl_size_t mitkIpFReadCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, FILE *stream)
#define _mitkIpPicTAGLEN
Definition: mitkIpPic.h:256
mitkIpPicTSV_t * mitkIpPicQueryTag(mitkIpPicDescriptor *pic, const char *t)
void mitkIpPicFreeTag(mitkIpPicTSV_t *tsv)
mitkIpPicDescriptor * mitkIpPicCopyHeader(mitkIpPicDescriptor *pic, mitkIpPicDescriptor *pic_new)
long pixel_start_in_file
Definition: mitkIpPic.h:773
mitkIpPicDescriptor * mitkIpPicClone(mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * _mitkIpPicOldGetSlice(FILE *infile, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
void _mitkIpCp(void *source, void *destination, unsigned long int len)
_mitkIpEndian_t _mitkIpEndian(void)
gzFile _mitkIpPicOpenPicFileIn(const char *path)
void * value
Definition: mitkIpPic.h:758
mitkIpBool_t write_protect
Definition: mitkIpPic.h:772
mitkIpBool_t _mitkIpPicCanWriteCompressed
mitkIpUInt4_t dim
Definition: mitkIpPic.h:785
char mitkIpPicTag_t[32]
Definition: mitkIpPic.h:725
_mitkIpEndian_t
Definition: mitkIpTypes.h:93
mitkIpPicTSV_t * mitkIpPicDelTag(mitkIpPicDescriptor *pic, const char *tag)
mitkIpUInt4_t bpe
Definition: mitkIpPic.h:784
mitkIpPicDescriptor * mitkIpPicNew(void)
vcl_size_t mitkIpPicFWriteCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, gzFile stream)
mitkIpUInt4_t _mitkIpPicTagsNumber(_mitkIpPicTagsElement_t *head)
mitkIpPicDescriptor * _mitkIpPicCopySlice(mitkIpPicDescriptor *pic, mitkIpPicDescriptor *pic_in, mitkIpUInt4_t slice)
int mitkIpPicAccess(const char *path, int mode)
#define mitkIpPicFile_t
Definition: mitkIpPic.h:573
int mitkIpPicRemoveFile(const char *path)
_mitkIpPicTagsElement_t * _mitkIpPicReadTags(_mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, FILE *stream, char encryption_type)