1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * filename: m-debug.c                                                     *
3  *                                                                         *
4  * UTIL C-source: Medical Image Conversion Utility                         *
5  *                                                                         *
6  * purpose      : print FILEINFO structure                                 *
7  *                                                                         *
8  * project      : (X)MedCon by Erik Nolf                                   *
9  *                                                                         *
10  * Functions    : MdcPrintFI()       - Display FILEINFO struct             *
11  *                MdcDebugPrint()    - Print MDC_MY_DEBUG info             *
12  *                                                                         *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 /*
15  */
16 
17 /*
18    Copyright (C) 1997-2021 by Erik Nolf
19 
20    This program is free software; you can redistribute it and/or modify it
21    under the terms of the GNU General Public License as published by the
22    Free Software Foundation; either version 2, or (at your option) any later
23    version.
24 
25    This program is distributed in the hope that it will be useful, but
26    WITHOUT ANY WARRANTY; without even the implied warranty of
27    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
28    Public License for more details.
29 
30    You should have received a copy of the GNU General Public License along
31    with this program; if not, write to the Free Software Foundation, Inc.,
32    59 Place - Suite 330, Boston, MA 02111-1307, USA.  */
33 
34 /****************************************************************************
35                               H E A D E R S
36 ****************************************************************************/
37 
38 #include <stdio.h>
39 #include <stdarg.h>
40 
41 #include "m-defs.h"
42 #include "m-fancy.h"
43 #include "m-files.h"
44 #include "m-debug.h"
45 
46 #if GLIBSUPPORTED
47 #include <glib.h>
48 #endif
49 
50 /****************************************************************************
51                             F U N C T I O N S
52 ****************************************************************************/
53 
MdcPrintFI(FILEINFO * fi)54 void MdcPrintFI(FILEINFO *fi)
55 {
56   Uint32 i, j;
57   int v;
58   float f;
59   IMG_DATA *id;
60 
61   MdcPrntScrn("\n");
62   MdcPrintLine('#',MDC_FULL_LENGTH);
63   MdcPrntScrn("FILEINFO - Global Data\n");
64   MdcPrintLine('#',MDC_FULL_LENGTH);
65   MdcPrntScrn("FILE *ifp          : ");
66   if (fi->ifp == NULL) MdcPrntScrn("<null>\n");
67   else MdcPrntScrn("%p\n",fi->ifp);
68   MdcPrntScrn("FILE *ofp          : ");
69   if (fi->ofp == NULL) MdcPrntScrn("<null>\n");
70   else MdcPrntScrn("%p\n",fi->ofp);
71   MdcPrntScrn("ipath              : %s\n",fi->ipath);
72   MdcPrntScrn("opath              : %s\n",fi->opath);
73   if (fi->idir == NULL)
74   MdcPrntScrn("idir               : <null>\n");
75   else
76   MdcPrntScrn("idir               : %s\n",fi->idir);
77   if (fi->odir == NULL)
78   MdcPrntScrn("odir               : <null>\n");
79   else
80   MdcPrntScrn("odir               : %s\n",fi->odir);
81   MdcPrntScrn("ifname             : %s\n",fi->ifname);
82   MdcPrntScrn("ofname             : %s\n",fi->ofname);
83   MdcPrntScrn("iformat            : %d (= %s)\n",fi->iformat
84                                                 ,FrmtString[fi->iformat]);
85   MdcPrntScrn("oformat            : %d (= %s)\n",fi->oformat
86                                                 ,FrmtString[fi->oformat]);
87   MdcPrntScrn("modality           : %d (= %s)\n",fi->modality
88                                             ,MdcGetStrModality(fi->modality));
89   v = (int)fi->rawconv;
90   MdcPrntScrn("rawconv            : %d (= %s)\n",v,MdcGetStrRawConv(v));
91   v = (int)fi->endian;
92   MdcPrntScrn("endian             : %d (= %s)\n",v,MdcGetStrEndian(v));
93   v = (int)fi->compression;
94   MdcPrntScrn("compression        : %d (= %s)\n",v,MdcGetStrCompression(v));
95   MdcPrntScrn("truncated          : %d ",fi->truncated);
96   MdcPrintYesNo(fi->truncated);
97   MdcPrntScrn("diff_type          : %d ",fi->diff_type);
98   MdcPrintYesNo(fi->diff_type);
99   MdcPrntScrn("diff_size          : %d ",fi->diff_size);
100   MdcPrintYesNo(fi->diff_size);
101   MdcPrntScrn("diff_scale         : %d ",fi->diff_scale);
102   MdcPrintYesNo(fi->diff_scale);
103   MdcPrntScrn("number             : %u\n",fi->number);
104   MdcPrntScrn("mwidth             : %u\n",fi->mwidth);
105   MdcPrntScrn("mheight            : %u\n",fi->mheight);
106   MdcPrntScrn("bits               : %hu\n",fi->bits);
107   v = (int)fi->type;
108   MdcPrntScrn("type               : %d (= %s)\n",v,MdcGetStrPixelType(v));
109   MdcPrntScrn("dim[0]             : %-5hd (= total in use)\n",fi->dim[0]);
110   MdcPrntScrn("dim[1]             : %-5hd (= pixels X-dim)\n",fi->dim[1]);
111   MdcPrntScrn("dim[2]             : %-5hd (= pixels Y-dim)\n",fi->dim[2]);
112   MdcPrntScrn("dim[3]             : %-5hd (= planes | (time) slices)\n"
113                                                                 ,fi->dim[3]);
114   MdcPrntScrn("dim[4]             : %-5hd (= frames | time slots | phases)\n"
115                                                                 ,fi->dim[4]);
116   MdcPrntScrn("dim[5]             : %-5hd (= gates  | R-R intervals)\n"
117                                                                 ,fi->dim[5]);
118   MdcPrntScrn("dim[6]             : %-5hd (= beds   | detector heads)\n"
119                                                                 ,fi->dim[6]);
120   MdcPrntScrn("dim[7]             : %-5hd (= ...    | energy windows)\n"
121                                                                 ,fi->dim[7]);
122   MdcPrntScrn("pixdim[0]          : %+e\n",fi->pixdim[0]);
123   MdcPrntScrn("pixdim[1]          : %+e [mm]\n",fi->pixdim[1]);
124   MdcPrntScrn("pixdim[2]          : %+e [mm]\n",fi->pixdim[2]);
125   MdcPrntScrn("pixdim[3]          : %+e [mm]\n",fi->pixdim[3]);
126   for (i=4; i<MDC_MAX_DIMS; i++)
127   MdcPrntScrn("pixdim[%u]          : %+e\n",i,fi->pixdim[i]);
128   MdcPrntScrn("glmin              : %+e\n",fi->glmin);
129   MdcPrntScrn("glmax              : %+e\n",fi->glmax);
130   MdcPrntScrn("qglmin             : %+e\n",fi->qglmin);
131   MdcPrntScrn("qglmax             : %+e\n",fi->qglmax);
132   MdcPrntScrn("contrast_remapped  : %hd ",fi->contrast_remapped);
133   MdcPrintYesNo(fi->contrast_remapped);
134   MdcPrntScrn("window_centre      : %g\n",fi->window_centre);
135   MdcPrntScrn("window_width       : %g\n",fi->window_width);
136   MdcPrntScrn("slice_projection   : %d (= %s)\n",fi->slice_projection,
137                                MdcGetStrSlProjection(fi->slice_projection));
138   MdcPrntScrn("pat_slice_orient   : %d (= %s)\n",fi->pat_slice_orient,
139                                MdcGetStrPatSlOrient(fi->pat_slice_orient));
140   MdcPrntScrn("pat_pos            : %s\n",fi->pat_pos);
141   MdcPrntScrn("pat_orient         : %s\n",fi->pat_orient);
142   MdcPrntScrn("patient_sex        : %s\n",fi->patient_sex);
143   MdcPrntScrn("patient_name       : %s\n",fi->patient_name);
144   MdcPrntScrn("patient_id         : %s\n",fi->patient_id);
145   MdcPrntScrn("patient_dob        : %s\n",fi->patient_dob);
146   MdcPrntScrn("patient_weight     : %.2f [kg]\n",fi->patient_weight);
147   MdcPrntScrn("patient_height     : %.2f [m]\n",fi->patient_height);
148   MdcPrntScrn("operator_name      : %s\n",fi->operator_name);
149   MdcPrntScrn("study_descr        : %s\n",fi->study_descr);
150   MdcPrntScrn("study_id           : %s\n",fi->study_id);
151   MdcPrntScrn("study_date_year    : %02d\n",fi->study_date_year);
152   MdcPrntScrn("study_date_month   : %02d\n",fi->study_date_month);
153   MdcPrntScrn("study_date_day     : %02d\n",fi->study_date_day);
154   MdcPrntScrn("study_time_hour    : %02d\n",fi->study_time_hour);
155   MdcPrntScrn("study_time_minute  : %02d\n",fi->study_time_minute);
156   MdcPrntScrn("study_time_second  : %02d\n",fi->study_time_second);
157   MdcPrntScrn("dose_time_hour     : %02d\n",fi->dose_time_hour);
158   MdcPrntScrn("dose_time_minute   : %02d\n",fi->dose_time_minute);
159   MdcPrntScrn("dose_time_second   : %02d\n",fi->dose_time_second);
160   MdcPrntScrn("nr_series          : %-10d ",fi->nr_series);
161   if (fi->nr_series < 0) MdcPrintYesNo(MDC_NO);
162   else MdcPrintYesNo(MDC_YES);
163   MdcPrntScrn("nr_acquisition     : %-10d ",fi->nr_acquisition);
164   if (fi->nr_acquisition < 0) MdcPrintYesNo(MDC_NO);
165   else MdcPrintYesNo(MDC_YES);
166   MdcPrntScrn("nr_instance        : %-10d ",fi->nr_instance);
167   if (fi->nr_instance < 0) MdcPrintYesNo(MDC_NO);
168   else MdcPrintYesNo(MDC_YES);
169   v = fi->acquisition_type;
170   MdcPrntScrn("acquisition_type   : %d (= %s)\n",v,MdcGetStrAcquisition(v));
171   MdcPrntScrn("planar             : %d ",fi->planar);
172   MdcPrintYesNo(fi->planar);
173   MdcPrntScrn("decay_corrected    : %d ",fi->decay_corrected);
174   MdcPrintYesNo(fi->decay_corrected);
175   MdcPrntScrn("flood_corrected    : %d ",fi->flood_corrected);
176   MdcPrintYesNo(fi->flood_corrected);
177   MdcPrntScrn("reconstructed      : %d ",fi->reconstructed);
178   MdcPrintYesNo(fi->reconstructed);
179   MdcPrntScrn("recon_method       : %s\n",fi->recon_method);
180   MdcPrntScrn("institution        : %s\n",fi->institution);
181   MdcPrntScrn("manufacturer       : %s\n",fi->manufacturer);
182   MdcPrntScrn("series_descr       : %s\n",fi->series_descr);
183   MdcPrntScrn("radiopharma        : %s\n",fi->radiopharma);
184   MdcPrntScrn("filter_type        : %s\n",fi->filter_type);
185   MdcPrntScrn("organ_code         : %s\n",fi->organ_code);
186   MdcPrntScrn("isotope_code       : %s\n",fi->isotope_code);
187   MdcPrntScrn("isotope_halflife   : %+e [sec] or %g [hrs]\n"
188                                          ,fi->isotope_halflife
189                                          ,fi->isotope_halflife/3600.);
190   MdcPrntScrn("injected_dose      : %+e [MBq]\n",fi->injected_dose);
191   MdcPrntScrn("gantry_tilt        : %+e [degrees]\n",fi->gantry_tilt);
192   v = (int) fi->map;
193   MdcPrntScrn("map                : %u (= %s)\n",v,MdcGetStrColorMap(v));
194   MdcPrntScrn("comm_length        : %u\n",fi->comm_length);
195   MdcPrntScrn("comment            : ");
196   if ((fi->comment != NULL) && (fi->comm_length != 0)) {
197     for (i=0; i<fi->comm_length; i++) MdcPrntScrn("%c",fi->comment[i]);
198   }else{
199     MdcPrntScrn("<null>");
200   }
201   MdcPrntScrn("\n");
202 
203   /* GATED DATA */
204   MdcPrntScrn("\ngatednr            : %u\n",fi->gatednr);
205   if (fi->gdata != NULL) {
206     for (i=0; i < fi->gatednr; i++) {
207        GATED_DATA *gd = &fi->gdata[i];
208 
209        MdcPrntScrn("\n");
210        MdcPrintLine('-',MDC_FULL_LENGTH);
211        MdcPrntScrn("FILEINFO - Gated (SPECT) Data #%.3u\n",i+1);
212        MdcPrintLine('-',MDC_FULL_LENGTH);
213        MdcPrntScrn("gspect_nesting     : %d (= %s)\n",gd->gspect_nesting
214               ,MdcGetStrGSpectNesting(gd->gspect_nesting));
215        MdcPrntScrn("nr_projections     : %g\n",gd->nr_projections);
216        MdcPrntScrn("extent_rotation    : %g\n",gd->extent_rotation);
217        MdcPrntScrn("study_duration     : %+e [ms] = %s\n"
218                   ,gd->study_duration,MdcGetStrHHMMSS(gd->study_duration));
219        MdcPrntScrn("image_duration     : %+e [ms] = %s\n"
220                   ,gd->image_duration,MdcGetStrHHMMSS(gd->image_duration));
221        MdcPrntScrn("time_per_proj      : %+e [ms] = %s\n"
222                   ,gd->time_per_proj,MdcGetStrHHMMSS(gd->time_per_proj));
223        MdcPrntScrn("window_low         : %+e [ms] = %s\n"
224                   ,gd->window_low,MdcGetStrHHMMSS(gd->window_low));
225        MdcPrntScrn("window_high        : %+e [ms] = %s\n"
226                   ,gd->window_high,MdcGetStrHHMMSS(gd->window_high));
227        MdcPrntScrn("cycles_observed    : %+e\n",gd->cycles_observed);
228        MdcPrntScrn("cycles_acquired    : %+e\n\n",gd->cycles_acquired);
229        MdcPrntScrn("heart rate (observed): %d [bpm] (auto-filled)\n"
230                         ,(int)MdcGetHeartRate(gd,MDC_HEART_RATE_OBSERVED));
231        MdcPrntScrn("heart rate (acquired): %d [bpm] (auto-filled)\n"
232                         ,(int)MdcGetHeartRate(gd,MDC_HEART_RATE_ACQUIRED));
233     }
234   }else{
235     MdcPrntScrn("gdata              : <null>\n");
236   }
237   /* ACQUISITION DATA */
238   MdcPrntScrn("\nacqnr              : %u\n",fi->acqnr);
239   if (fi->acqdata != NULL) {
240     for (i=0; i < fi->acqnr; i++) {
241        ACQ_DATA *acq = &fi->acqdata[i];
242 
243        MdcPrntScrn("\n");
244        MdcPrintLine('-',MDC_FULL_LENGTH);
245        MdcPrntScrn("FILEINFO - Acquisition Data #%.3u\n",i+1);
246        MdcPrintLine('-',MDC_FULL_LENGTH);
247        v = acq->rotation_direction;
248        MdcPrntScrn("rotation_direction : %d (= %s)\n",v,MdcGetStrRotation(v));
249        v = acq->detector_motion;
250        MdcPrntScrn("detector_motion    : %d (= %s)\n",v,MdcGetStrMotion(v));
251        MdcPrntScrn("rotation_offset    : %g [mm]\n",acq->rotation_offset);
252        MdcPrntScrn("radial_position    : %g [mm]\n",acq->radial_position);
253        MdcPrntScrn("angle_start        : %g [degrees]\n",acq->angle_start);
254        MdcPrntScrn("angle_step         : %g [degrees]\n",acq->angle_step);
255        MdcPrntScrn("scan_arc           : %g [degrees]\n",acq->scan_arc);
256     }
257   }else{
258     MdcPrntScrn("acqdata            : <null>\n");
259   }
260 
261   /* DYNAMIC DATA */
262   MdcPrntScrn("\ndynnr              : %u\n",fi->dynnr);
263   if (fi->dyndata != NULL) {
264     for (i=0; i < fi->dynnr; i++) {
265        DYNAMIC_DATA *dd = &fi->dyndata[i];
266 
267        MdcPrntScrn("\n");
268        MdcPrintLine('-',MDC_FULL_LENGTH);
269        MdcPrntScrn("FILEINFO - Dynamic Data #%.3u\n",i+1);
270        MdcPrintLine('-',MDC_FULL_LENGTH);
271        MdcPrntScrn("number of slices   : %u\n",dd->nr_of_slices);
272        MdcPrntScrn("time_frame_start   : %+e [ms] = %s\n"
273              ,dd->time_frame_start,MdcGetStrHHMMSS(dd->time_frame_start));
274        MdcPrntScrn("time_frame_delay   : %+e [ms] = %s\n"
275              ,dd->time_frame_delay,MdcGetStrHHMMSS(dd->time_frame_delay));
276        MdcPrntScrn("time_frame_duration: %+e [ms] = %s\n"
277              ,dd->time_frame_duration,MdcGetStrHHMMSS(dd->time_frame_duration));
278        MdcPrntScrn("delay_slices       : %+e [ms] = %s\n"
279              ,dd->delay_slices,MdcGetStrHHMMSS(dd->delay_slices));
280     }
281   }else{
282     MdcPrntScrn("dyndata            : <null>\n");
283   }
284 
285   /* BED DATA */
286   MdcPrntScrn("\nbednr              : %u\n",fi->bednr);
287   if (fi->beddata != NULL) {
288     for (i=0; i < fi->bednr; i++) {
289        BED_DATA *bd = &fi->beddata[i];
290 
291        MdcPrntScrn("\n");
292        MdcPrintLine('-',MDC_FULL_LENGTH);
293        MdcPrntScrn("FILEINFO - Bed Data #%.3u\n",i+1);
294        MdcPrintLine('-',MDC_FULL_LENGTH);
295        MdcPrntScrn("hoffset            : %+e [mm]\n"
296              ,bd->hoffset);
297        MdcPrntScrn("voffset            : %+e [mm]\n"
298              ,bd->voffset);
299     }
300   }else{
301     MdcPrntScrn("beddata            : <null>\n");
302   }
303 
304   /* IMAGE DATA */
305   for (i=0; i<fi->number; i++) {
306      id = &fi->image[i];
307      MdcPrntScrn("\n");
308      MdcPrintLine('-',MDC_FULL_LENGTH);
309      MdcPrntScrn("FILEINFO - Image Data #%.3u\n",i+1);
310      MdcPrintLine('-',MDC_FULL_LENGTH);
311      MdcPrntScrn("width              : %u\n",id->width);
312      MdcPrntScrn("height             : %u\n",id->height);
313      MdcPrntScrn("bits               : %hd\n",id->bits);
314      MdcPrntScrn("type               : %hd (= %s)\n",id->type
315                                              ,MdcGetStrPixelType(id->type));
316      MdcPrntScrn("flags              : 0x%x\n",id->flags);
317      MdcPrntScrn("min                : %+e\n",id->min);
318      MdcPrntScrn("max                : %+e\n",id->max);
319      MdcPrntScrn("qmin               : %+e\n",id->qmin);
320      MdcPrntScrn("qmax               : %+e\n",id->qmax);
321      MdcPrntScrn("fmin               : %+e\n",id->fmin);
322      MdcPrntScrn("fmax               : %+e\n",id->fmax);
323      MdcPrntScrn("qfmin              : %+e\n",id->qfmin);
324      MdcPrntScrn("qfmax              : %+e\n",id->qfmax);
325      MdcPrntScrn("rescale_slope      : %+e\n",id->rescale_slope);
326      MdcPrntScrn("rescale_intercept  : %+e\n",id->rescale_intercept);
327      MdcPrntScrn("frame_number       : %u\n",id->frame_number);
328      MdcPrntScrn("slice_start        : %+e [ms] = %s\n"
329                 ,id->slice_start,MdcGetStrHHMMSS(id->slice_start));
330      f = MdcSingleImageDuration(fi,id->frame_number-1);
331      MdcPrntScrn("slice_duration     : %+e [ms] = %s (auto-filled)\n"
332                 ,f,MdcGetStrHHMMSS(f));
333      MdcPrntScrn("rescaled           : %d ",id->rescaled);
334      MdcPrintYesNo(id->rescaled);
335      MdcPrntScrn("rescaled_min       : %+e\n",id->rescaled_min);
336      MdcPrntScrn("rescaled_max       : %+e\n",id->rescaled_max);
337      MdcPrntScrn("rescaled_fctr      : %+e\n",id->rescaled_fctr);
338      MdcPrntScrn("rescaled_slope     : %+e\n",id->rescaled_slope);
339      MdcPrntScrn("rescaled_intercept : %+e\n",id->rescaled_intercept);
340      MdcPrntScrn("buf                : %p\n",id->buf);
341      MdcPrntScrn("load_location      : %ld\n",id->load_location);
342      MdcPrntScrn("quant_units        : %hd\n",id->quant_units);
343      MdcPrntScrn("calibr_units       : %hd\n",id->calibr_units);
344      MdcPrntScrn("quant_scale        : %+e\n",id->quant_scale);
345      MdcPrntScrn("calibr_fctr        : %+e\n",id->calibr_fctr);
346      MdcPrntScrn("intercept          : %+e\n",id->intercept);
347      MdcPrntScrn("pixel_xsize        : %+e [mm]\n",id->pixel_xsize);
348      MdcPrntScrn("pixel_ysize        : %+e [mm]\n",id->pixel_ysize);
349      MdcPrntScrn("slice_width        : %+e [mm]\n",id->slice_width);
350      MdcPrntScrn("recon_scale        : %+e\n",id->recon_scale);
351      for (j=0; j<3; j++) MdcPrntScrn("image_pos_dev[%u]   : %+e [mm]\n",j
352                                                       ,id->image_pos_dev[j]);
353      for (j=0; j<3; j++) MdcPrntScrn("image_pos_pat[%u]   : %+e [mm]\n",j
354                                                       ,id->image_pos_pat[j]);
355      for (j=0; j<6; j++) MdcPrntScrn("image_orient_dev[%u]: %+e [mm]\n",j
356                                                       ,id->image_orient_dev[j]);
357      for (j=0; j<6; j++) MdcPrntScrn("image_orient_pat[%u]: %+e [mm]\n",j
358                                                       ,id->image_orient_pat[j]);
359      MdcPrntScrn("slice_spacing      : %+e [mm]\n",id->slice_spacing);
360      MdcPrntScrn("ct_zoom_fctr       : %+e\n",id->ct_zoom_fctr);
361 
362      if (id->sdata != NULL) {
363        STATIC_DATA *sd = id->sdata;
364        MdcPrntScrn("\n");
365        MdcPrintLine('-',MDC_HALF_LENGTH);
366        MdcPrntScrn("FILEINFO - Static Data #%.3u\n",i+1);
367        MdcPrintLine('-',MDC_HALF_LENGTH);
368        MdcPrntScrn("label              : %s\n",sd->label);
369        MdcPrntScrn("total_counts       : %g\n",sd->total_counts);
370        MdcPrntScrn("image_duration     : %+e [ms] = %s\n"
371                   ,sd->image_duration,MdcGetStrHHMMSS(sd->image_duration));
372        MdcPrntScrn("start_time_hour    : %02hd\n",sd->start_time_hour);
373        MdcPrntScrn("start_time_minute  : %02hd\n",sd->start_time_minute);
374        MdcPrntScrn("start_time_second  : %02hd\n",sd->start_time_second);
375        MdcPrintLine('-',MDC_HALF_LENGTH);
376      }
377  }
378 
379  /* DICOM MOD */
380  if (fi->mod != NULL) {
381    GN_INFO *gn = &fi->mod->gn_info;
382    MR_INFO *mr = &fi->mod->mr_info;
383 
384    MdcPrntScrn("\n");
385    MdcPrintLine('-',MDC_HALF_LENGTH);
386    MdcPrntScrn("FILEINFO - DICOM General Info\n");
387    MdcPrintLine('-',MDC_HALF_LENGTH);
388 
389    MdcPrntScrn("study_date            : %s\n",gn->study_date);
390    MdcPrntScrn("study_time            : %s\n",gn->study_time);
391    MdcPrntScrn("series_date           : %s\n",gn->series_date);
392    MdcPrntScrn("series_time           : %s\n",gn->series_time);
393    MdcPrntScrn("acquisition_date      : %s\n",gn->acquisition_date);
394    MdcPrntScrn("acquisition_time      : %s\n",gn->acquisition_time);
395    MdcPrntScrn("image_date            : %s\n",gn->image_date);
396    MdcPrntScrn("image_time            : %s\n",gn->image_time);
397 
398    switch (fi->modality) {
399      case M_MR:
400          MdcPrintLine('-',MDC_HALF_LENGTH);
401          MdcPrntScrn("FILEINFO - DICOM MR Modality Info\n");
402          MdcPrintLine('-',MDC_HALF_LENGTH);
403          MdcPrntScrn("repetition_time       : %f\n",mr->repetition_time);
404          MdcPrntScrn("echo_time             : %g\n",mr->echo_time);
405          MdcPrntScrn("inversion_time        : %g\n",mr->inversion_time);
406          MdcPrntScrn("num_averages          : %g\n",mr->num_averages);
407          MdcPrntScrn("imaging_freq          : %f\n",mr->imaging_freq);
408          MdcPrntScrn("pixel_bandwidth       : %g\n",mr->pixel_bandwidth);
409          MdcPrntScrn("flip_angle            : %g\n",mr->flip_angle);
410          MdcPrntScrn("dbdt                  : %g\n",mr->dbdt);
411          MdcPrntScrn("transducer_freq       : %u\n",mr->transducer_freq);
412          MdcPrntScrn("transducer_type       : %s\n",mr->transducer_type);
413          MdcPrntScrn("pulse_repetition_freq : %u\n",mr->pulse_repetition_freq);
414          MdcPrntScrn("pulse_seq_name        : %s\n",mr->pulse_seq_name);
415          MdcPrntScrn("steady_state_pulse_seq: %s\n",mr->steady_state_pulse_seq);
416          MdcPrntScrn("slab_thickness        : %g\n",mr->slab_thickness);
417          MdcPrntScrn("sampling_freq         : %g\n",mr->sampling_freq);
418          break;
419    }
420  }
421 
422 }
423 
424 
MdcDebugPrint(char * fmt,...)425 void MdcDebugPrint(char *fmt, ...)
426 {
427   va_list args;
428 
429   if (MDC_MY_DEBUG) {
430     va_start(args,fmt);
431 #if GLIBSUPPORTED
432     g_logv(MDC_PRGR,G_LOG_LEVEL_DEBUG, fmt, args);
433 #else
434     fprintf(stdout,"\n%s:  Debug : ",MDC_PRGR);
435     vsprintf(mdcbufr, fmt, args);
436     fprintf(stdout,"%s",mdcbufr);
437     fflush(stdout);
438 #endif
439     va_end(args);
440   }
441 
442 }
443 
444