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