1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkGESignaReader.cxx
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #include "vtkGESignaReader.h"
16 
17 #include "vtkByteSwap.h"
18 #include "vtkDataArray.h"
19 #include "vtkImageData.h"
20 #include "vtkMedicalImageProperties.h"
21 #include "vtkObjectFactory.h"
22 #include "vtkPointData.h"
23 #include <vtksys/SystemTools.hxx>
24 
25 #include <cassert>
26 #include <vector>
27 
28 vtkStandardNewMacro(vtkGESignaReader);
29 
CanReadFile(const char * fname)30 int vtkGESignaReader::CanReadFile(const char* fname)
31 {
32   FILE* fp = vtksys::SystemTools::Fopen(fname, "rb");
33   if (!fp)
34   {
35     return 0;
36   }
37 
38   int magic;
39   if (fread(&magic, 4, 1, fp) != 1)
40   {
41     fclose(fp);
42     return 0;
43   }
44   vtkByteSwap::Swap4BE(&magic);
45 
46   if (magic != 0x494d4746) // "IMGF"
47   {
48     fclose(fp);
49     return 0;
50   }
51   fclose(fp);
52   return 3;
53 }
54 
ExecuteInformation()55 void vtkGESignaReader::ExecuteInformation()
56 {
57   this->ComputeInternalFileName(this->DataExtent[4]);
58   if (this->InternalFileName == nullptr)
59   {
60     return;
61   }
62 
63   FILE* fp = vtksys::SystemTools::Fopen(this->InternalFileName, "rb");
64   if (!fp)
65   {
66     vtkErrorMacro("Unable to open file " << this->InternalFileName);
67     return;
68   }
69 
70   int magic;
71   if (fread(&magic, 4, 1, fp) != 1)
72   {
73     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
74                                                        << " Premature EOF while reading magic.");
75     fclose(fp);
76     return;
77   }
78   vtkByteSwap::Swap4BE(&magic);
79 
80   if (magic != 0x494d4746)
81   {
82     vtkErrorMacro(<< "Unknown file type! Not a GE ximg file!");
83     fclose(fp);
84     return;
85   }
86 
87   // read in the pixel offset from the header
88   int offset;
89   if (fread(&offset, 4, 1, fp) != 1)
90   {
91     vtkErrorMacro("GESignaReader error reading file: "
92       << this->FileName << " Premature EOF while reading pixel offset.");
93     fclose(fp);
94     return;
95   }
96   vtkByteSwap::Swap4BE(&offset);
97   this->SetHeaderSize(offset);
98 
99   int width, height, depth;
100   if (fread(&width, 4, 1, fp) != 1)
101   {
102     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
103                                                        << " Premature EOF while reading width.");
104     fclose(fp);
105     return;
106   }
107   vtkByteSwap::Swap4BE(&width);
108   if (fread(&height, 4, 1, fp) != 1)
109   {
110     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
111                                                        << " Premature EOF while reading height.");
112     fclose(fp);
113     return;
114   }
115   vtkByteSwap::Swap4BE(&height);
116   // depth in bits
117   if (fread(&depth, 4, 1, fp) != 1)
118   {
119     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
120                                                        << " Premature EOF while reading depth.");
121     fclose(fp);
122     return;
123   }
124   vtkByteSwap::Swap4BE(&depth);
125 
126   int compression;
127   if (fread(&compression, 4, 1, fp) != 1)
128   {
129     vtkErrorMacro("GESignaReader error reading file: "
130       << this->FileName << " Premature EOF while reading compression.");
131     fclose(fp);
132     return;
133   }
134   vtkByteSwap::Swap4BE(&compression);
135 
136   // seek to the exam series and image header offsets
137   fseek(fp, 132, SEEK_SET);
138   int examHdrOffset;
139   if (fread(&examHdrOffset, 4, 1, fp) != 1)
140   {
141     vtkErrorMacro("GESignaReader error reading file: "
142       << this->FileName << " Premature EOF while reading exam header offset.");
143     fclose(fp);
144     return;
145   }
146   vtkByteSwap::Swap4BE(&examHdrOffset);
147   fseek(fp, 140, SEEK_SET);
148   int seriesHdrOffset;
149   if (fread(&seriesHdrOffset, 4, 1, fp) != 1)
150   {
151     vtkErrorMacro("GESignaReader error reading file: "
152       << this->FileName << " Premature EOF while series header offset.");
153     fclose(fp);
154     return;
155   }
156   vtkByteSwap::Swap4BE(&seriesHdrOffset);
157   fseek(fp, 148, SEEK_SET);
158   int imgHdrOffset;
159   if (fread(&imgHdrOffset, 4, 1, fp) != 1)
160   {
161     vtkErrorMacro("GESignaReader error reading file: "
162       << this->FileName << " Premature EOF while image header offset.");
163     fclose(fp);
164     return;
165   }
166   vtkByteSwap::Swap4BE(&imgHdrOffset);
167 
168   // seek to the exam and read some info
169   char tmpStr[1024];
170   // suite ID
171   fseek(fp, examHdrOffset + 0, SEEK_SET);
172   if (fread(tmpStr, 4, 1, fp) != 1)
173   {
174     vtkErrorMacro(
175       "GESignaReader error reading file: " << this->FileName << " Premature EOF while suite ID.");
176     fclose(fp);
177     return;
178   }
179   tmpStr[4] = 0;
180   this->GetMedicalImageProperties()->SetStudyDescription(tmpStr); // StudyID would be more suited...
181   // exam number
182   fseek(fp, examHdrOffset + 8, SEEK_SET);
183   unsigned short examnumber;
184   if (fread(&examnumber, 2, 1, fp) != 1)
185   {
186     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
187                                                        << " Premature EOF while exam number.");
188     fclose(fp);
189     return;
190   }
191   vtkByteSwap::Swap2BE(&examnumber);
192   snprintf(tmpStr, sizeof(tmpStr), "%d", examnumber);
193   // this->SetStudyNumber(tmpStr);
194   // Patient ID
195   fseek(fp, examHdrOffset + 84, SEEK_SET);
196   if (fread(tmpStr, 13, 1, fp) != 1)
197   {
198     vtkErrorMacro(
199       "GESignaReader error reading file: " << this->FileName << " Premature EOF while patient ID.");
200     fclose(fp);
201     return;
202   }
203   tmpStr[13] = 0;
204   this->SetPatientID(tmpStr);
205   // Patient Name
206   if (fread(tmpStr, 25, 1, fp) != 1)
207   {
208     vtkErrorMacro("GESignaReader error reading file: "
209       << this->FileName << " Premature EOF while reading patient name.");
210     fclose(fp);
211     return;
212   }
213   tmpStr[25] = 0;
214   this->SetPatientName(tmpStr);
215   // Patient Age
216   fseek(fp, examHdrOffset + 122, SEEK_SET);
217   short patientage;
218   if (fread(&patientage, 2, 1, fp) != 1)
219   {
220     vtkErrorMacro("GESignaReader error reading file: "
221       << this->FileName << " Premature EOF while reading patient age.");
222     fclose(fp);
223     return;
224   }
225   vtkByteSwap::Swap2BE(&patientage);
226   snprintf(tmpStr, sizeof(tmpStr), "%d", patientage);
227   this->GetMedicalImageProperties()->SetPatientAge(tmpStr);
228   // Patient Sex
229   fseek(fp, examHdrOffset + 126, SEEK_SET);
230   short patientsex;
231   if (fread(&patientsex, 2, 1, fp) != 1)
232   {
233     vtkErrorMacro("GESignaReader error reading file: "
234       << this->FileName << " Premature EOF while reading patient sex.");
235     fclose(fp);
236     return;
237   }
238   vtkByteSwap::Swap2BE(&patientsex);
239   snprintf(tmpStr, sizeof(tmpStr), "%d", patientsex);
240   this->GetMedicalImageProperties()->SetPatientSex(tmpStr);
241   // Modality
242   fseek(fp, examHdrOffset + 305, SEEK_SET);
243   if (fread(tmpStr, 3, 1, fp) != 1)
244   {
245     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
246                                                        << " Premature EOF while reading modality.");
247     fclose(fp);
248     return;
249   }
250   tmpStr[3] = 0;
251   this->SetModality(tmpStr);
252 
253   // seek to the series and read some info
254   // series number
255   fseek(fp, seriesHdrOffset + 10, SEEK_SET);
256   short series;
257   if (fread(&series, 2, 1, fp) != 1)
258   {
259     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
260                                                        << " Premature EOF while reading series.");
261     fclose(fp);
262     return;
263   }
264   vtkByteSwap::Swap2BE(&series);
265   snprintf(tmpStr, sizeof(tmpStr), "%d", series);
266   this->SetSeries(tmpStr);
267   // scan protocol name
268   fseek(fp, seriesHdrOffset + 92, SEEK_SET);
269   if (fread(tmpStr, 25, 1, fp) != 1)
270   {
271     vtkErrorMacro("GESignaReader error reading file: "
272       << this->FileName << " Premature EOF while reading scan protocol.");
273     fclose(fp);
274     return;
275   }
276   tmpStr[25] = 0;
277   this->SetStudy(tmpStr); // ??
278 
279   // now seek to the image header and read some values
280   float tmpX, tmpY, tmpZ;
281   float spacingX, spacingY, spacingZ;
282   fseek(fp, imgHdrOffset + 50, SEEK_SET);
283   if (fread(&spacingX, 4, 1, fp) != 1)
284   {
285     vtkErrorMacro("GESignaReader error reading file: "
286       << this->FileName << " Premature EOF while reading spacing x.");
287     fclose(fp);
288     return;
289   }
290   vtkByteSwap::Swap4BE(&spacingX);
291   if (fread(&spacingY, 4, 1, fp) != 1)
292   {
293     vtkErrorMacro("GESignaReader error reading file: "
294       << this->FileName << " Premature EOF while reading spacing y.");
295     fclose(fp);
296     return;
297   }
298   vtkByteSwap::Swap4BE(&spacingY);
299   fseek(fp, imgHdrOffset + 116, SEEK_SET);
300   if (fread(&spacingZ, 4, 1, fp) != 1)
301   {
302     vtkErrorMacro("GESignaReader error reading file: "
303       << this->FileName << " Premature EOF while reading spacing z.");
304     fclose(fp);
305     return;
306   }
307   vtkByteSwap::Swap4BE(&spacingZ);
308   // Slice Thickness
309   fseek(fp, imgHdrOffset + 26, SEEK_SET);
310   if (fread(&tmpZ, 4, 1, fp) != 1)
311   {
312     vtkErrorMacro("GESignaReader error reading file: "
313       << this->FileName << " Premature EOF while reading slice thickness.");
314     fclose(fp);
315     return;
316   }
317   vtkByteSwap::Swap4BE(&tmpZ);
318   spacingZ = spacingZ + tmpZ;
319 
320   float origX, origY, origZ;
321   fseek(fp, imgHdrOffset + 154, SEEK_SET);
322   // read TLHC
323   if (fread(&origX, 4, 1, fp) != 1)
324   {
325     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
326                                                        << " Premature EOF while reading origX.");
327     fclose(fp);
328     return;
329   }
330   vtkByteSwap::Swap4BE(&origX);
331   if (fread(&origY, 4, 1, fp) != 1)
332   {
333     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
334                                                        << " Premature EOF while reading origY.");
335     fclose(fp);
336     return;
337   }
338   vtkByteSwap::Swap4BE(&origY);
339   if (fread(&origZ, 4, 1, fp) != 1)
340   {
341     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
342                                                        << " Premature EOF while reading origZ.");
343     fclose(fp);
344     return;
345   }
346   vtkByteSwap::Swap4BE(&origZ);
347 
348   // read TRHC
349   if (fread(&tmpX, 4, 1, fp) != 1)
350   {
351     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
352                                                        << " Premature EOF while reading TRHC x.");
353     fclose(fp);
354     return;
355   }
356   vtkByteSwap::Swap4BE(&tmpX);
357   if (fread(&tmpY, 4, 1, fp) != 1)
358   {
359     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
360                                                        << " Premature EOF while reading TRCH y.");
361     fclose(fp);
362     return;
363   }
364   vtkByteSwap::Swap4BE(&tmpY);
365   if (fread(&tmpZ, 4, 1, fp) != 1)
366   {
367     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
368                                                        << " Premature EOF while reading TRCH z.");
369     fclose(fp);
370     return;
371   }
372   vtkByteSwap::Swap4BE(&tmpZ);
373 
374   // compute BLHC = TLHC - TRHC + BRHC
375   origX = origX - tmpX;
376   origY = origY - tmpY;
377   origZ = origZ - tmpZ;
378 
379   // read BRHC
380   if (fread(&tmpX, 4, 1, fp) != 1)
381   {
382     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
383                                                        << " Premature EOF while reading BRHC x.");
384     fclose(fp);
385     return;
386   }
387   vtkByteSwap::Swap4BE(&tmpX);
388   if (fread(&tmpY, 4, 1, fp) != 1)
389   {
390     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
391                                                        << " Premature EOF while reading BRHC y.");
392     fclose(fp);
393     return;
394   }
395   vtkByteSwap::Swap4BE(&tmpY);
396   if (fread(&tmpZ, 4, 1, fp) != 1)
397   {
398     vtkErrorMacro("GESignaReader error reading file: " << this->FileName
399                                                        << " Premature EOF while reading BRCH z.");
400     fclose(fp);
401     return;
402   }
403   vtkByteSwap::Swap4BE(&tmpZ);
404 
405   // compute BLHC = TLHC - TRHC + BRHC
406   origX = origX + tmpX;
407   origY = origY + tmpY;
408   origZ = origZ + tmpZ;
409 
410   /*
411   http://www.dclunie.com/medical-image-faq/html/part4.html#Signa5X
412   image header - for MR (1022 bytes long):
413 
414   194 - int      - repetition time(usec)
415   198 - int      - inversion time(usec)
416   202 - int      - echo time(usec)
417   210 - short    - number of echoes
418   212 - short    - echo number
419   218 - float    - NEX
420   308 - char[33] - pulse sequence name
421   362 - char[17] - coil name
422   640 - short    - ETL for FSE
423    */
424 
425   this->SetDataOrigin(origX, origY, origZ);
426 
427   this->DataExtent[0] = 0;
428   this->DataExtent[1] = width - 1;
429   this->DataExtent[2] = 0;
430   this->DataExtent[3] = height - 1;
431 
432   this->SetDataScalarTypeToUnsignedShort();
433 
434   this->SetNumberOfScalarComponents(1);
435   this->SetDataSpacing(spacingX, spacingY, spacingZ);
436   this->vtkImageReader2::ExecuteInformation();
437 
438   // close the file
439   fclose(fp);
440 }
441 
vtkcopygenesisimage(FILE * infp,int width,int height,int compress,short * map_left,short * map_wide,unsigned short * output)442 static void vtkcopygenesisimage(FILE* infp, int width, int height, int compress, short* map_left,
443   short* map_wide, unsigned short* output)
444 {
445   unsigned short last_pixel = 0;
446   for (int row = 0; row < height; ++row)
447   {
448     unsigned short start;
449     unsigned short end;
450 
451     if (compress == 2 || compress == 4)
452     { // packed/compacked
453       assert(map_left);
454       assert(map_wide);
455       start = map_left[row];
456       end = start + map_wide[row];
457     }
458     else
459     {
460       start = 0;
461       end = width;
462     }
463     // Pad the first "empty" part of the line ...
464     for (unsigned short k = 0; k < start; k++)
465     {
466       (*output) = 0;
467       ++output;
468     }
469 
470     if (compress == 3 || compress == 4)
471     { // compressed/compacked
472       while (start < end)
473       {
474         unsigned char byte;
475         if (!fread(&byte, 1, 1, infp))
476         {
477           return;
478         }
479         if (byte & 0x80)
480         {
481           unsigned char byte2;
482           if (!fread(&byte2, 1, 1, infp))
483           {
484             return;
485           }
486           if (byte & 0x40)
487           { // next word
488             if (!fread(&byte, 1, 1, infp))
489             {
490               return;
491             }
492             last_pixel = (((unsigned short)byte2 << 8) + byte);
493           }
494           else
495           { // 14 bit delta
496             if (byte & 0x20)
497             {
498               byte |= 0xe0;
499             }
500             else
501             {
502               byte &= 0x1f;
503             }
504             last_pixel += (((short)byte << 8) + byte2);
505           }
506         }
507         else
508         { // 7 bit delta
509           if (byte & 0x40)
510           {
511             byte |= 0xc0;
512           }
513           last_pixel += (signed char)byte;
514         }
515         (*output) = last_pixel;
516         ++output;
517         ++start;
518       }
519     }
520     else
521     {
522       while (start < end)
523       {
524         unsigned short u;
525         if (!fread(&u, 2, 1, infp))
526         {
527           return;
528         }
529         vtkByteSwap::Swap2BE(&u);
530         (*output) = u;
531         ++output;
532         ++start;
533       }
534     }
535 
536     // Pad the last "empty" part of the line ...
537     for (int j = end; j < width; j++)
538     {
539       (*output) = 0;
540       ++output;
541     }
542   }
543 }
544 
vtkGESignaReaderUpdate2(vtkGESignaReader * self,unsigned short * outPtr,int * outExt,vtkIdType *)545 static void vtkGESignaReaderUpdate2(
546   vtkGESignaReader* self, unsigned short* outPtr, int* outExt, vtkIdType*)
547 {
548   FILE* fp = vtksys::SystemTools::Fopen(self->GetInternalFileName(), "rb");
549   if (!fp)
550   {
551     return;
552   }
553 
554   int magic;
555   if (fread(&magic, 4, 1, fp) != 1)
556   {
557     vtkGenericWarningMacro("GESignaReader error reading file: "
558       << self->GetInternalFileName() << " Premature EOF while reading magic.");
559     fclose(fp);
560     return;
561   }
562   vtkByteSwap::Swap4BE(&magic);
563 
564   if (magic != 0x494d4746)
565   {
566     vtkGenericWarningMacro(<< "Unknown file type! Not a GE ximg file!");
567     fclose(fp);
568     return;
569   }
570 
571   // read in the pixel offset from the header
572   int offset;
573   if (fread(&offset, 4, 1, fp) != 1)
574   {
575     vtkGenericWarningMacro("GESignaReader error reading file: "
576       << self->GetInternalFileName() << " Premature EOF while reading origY.");
577     fclose(fp);
578     return;
579   }
580   vtkByteSwap::Swap4BE(&offset);
581 
582   int width, height, depth;
583   if (fread(&width, 4, 1, fp) != 1)
584   {
585     vtkGenericWarningMacro("GESignaReader error reading file: "
586       << self->GetInternalFileName() << " Premature EOF while reading width.");
587     fclose(fp);
588     return;
589   }
590   vtkByteSwap::Swap4BE(&width);
591   if (fread(&height, 4, 1, fp) != 1)
592   {
593     vtkGenericWarningMacro("GESignaReader error reading file: "
594       << self->GetInternalFileName() << " Premature EOF while reading height.");
595     fclose(fp);
596     return;
597   }
598   vtkByteSwap::Swap4BE(&height);
599   // depth in bits
600   if (fread(&depth, 4, 1, fp) != 1)
601   {
602     vtkGenericWarningMacro("GESignaReader error reading file: "
603       << self->GetInternalFileName() << " Premature EOF while reading depth.");
604     fclose(fp);
605     return;
606   }
607   vtkByteSwap::Swap4BE(&depth);
608 
609   int compression;
610   if (fread(&compression, 4, 1, fp) != 1)
611   {
612     vtkGenericWarningMacro("GESignaReader error reading file: "
613       << self->GetInternalFileName() << " Premature EOF while reading compression.");
614     fclose(fp);
615     return;
616   }
617   vtkByteSwap::Swap4BE(&compression);
618 
619   std::vector<short> leftMap;
620   std::vector<short> widthMap;
621 
622   if (compression == 2 || compression == 4)
623   { // packed/compacked
624 
625     leftMap.resize(height);
626     widthMap.resize(height);
627 
628     fseek(fp, 64, SEEK_SET);
629     int packHdrOffset;
630     if (fread(&packHdrOffset, 4, 1, fp) != 1)
631     {
632       vtkGenericWarningMacro("GESignaReader error reading file: "
633         << self->GetInternalFileName() << " Premature EOF while reading packHdrOffset.");
634       fclose(fp);
635       return;
636     }
637     vtkByteSwap::Swap4BE(&packHdrOffset);
638 
639     // now seek to the pack header and read some values
640     fseek(fp, packHdrOffset, SEEK_SET);
641     // read in the maps
642     int i;
643     for (i = 0; i < height; i++)
644     {
645       if (fread(leftMap.data() + i, 2, 1, fp) != 1)
646       {
647         vtkGenericWarningMacro("GESignaReader error reading file: "
648           << self->GetInternalFileName() << " Premature EOF while reading maps.");
649         fclose(fp);
650         return;
651       }
652       vtkByteSwap::Swap2BE(leftMap.data() + i);
653       if (fread(widthMap.data(), 2, 1, fp) != 1)
654       {
655         vtkGenericWarningMacro("GESignaReader error reading file: "
656           << self->GetInternalFileName() << " Premature EOF while reading maps.");
657         fclose(fp);
658         return;
659       }
660       vtkByteSwap::Swap2BE(widthMap.data() + i);
661     }
662   }
663 
664   // seek to pixel data
665   fseek(fp, offset, SEEK_SET);
666 
667   // read in the pixels
668   std::vector<unsigned short> tmp(width * height);
669   int* dext = self->GetDataExtent();
670   vtkcopygenesisimage(
671     fp, dext[1] + 1, dext[3] + 1, compression, leftMap.data(), widthMap.data(), tmp.data());
672 
673   // now copy into desired extent
674   int yp;
675   for (yp = outExt[2]; yp <= outExt[3]; ++yp)
676   {
677     int ymod = height - yp - 1;
678     memcpy(outPtr, tmp.data() + ymod * width + outExt[0], 2 * width);
679     outPtr = outPtr + width;
680   }
681 
682   fclose(fp);
683 }
684 
685 //------------------------------------------------------------------------------
686 // This function reads in one data of data.
687 // templated to handle different data types.
vtkGESignaReaderUpdate(vtkGESignaReader * self,vtkImageData * data,unsigned short * outPtr)688 static void vtkGESignaReaderUpdate(
689   vtkGESignaReader* self, vtkImageData* data, unsigned short* outPtr)
690 {
691   vtkIdType outIncr[3];
692   int outExtent[6];
693   unsigned short* outPtr2;
694 
695   data->GetExtent(outExtent);
696   data->GetIncrements(outIncr);
697 
698   outPtr2 = outPtr;
699   int idx2;
700   for (idx2 = outExtent[4]; idx2 <= outExtent[5]; ++idx2)
701   {
702     self->ComputeInternalFileName(idx2);
703     // read in a PNG file
704     vtkGESignaReaderUpdate2(self, outPtr2, outExtent, outIncr);
705     self->UpdateProgress((idx2 - outExtent[4]) / (outExtent[5] - outExtent[4] + 1.0));
706     outPtr2 += outIncr[2];
707   }
708 }
709 
710 //------------------------------------------------------------------------------
711 // This function reads a data from a file.  The datas extent/axes
712 // are assumed to be the same as the file extent/order.
ExecuteDataWithInformation(vtkDataObject * output,vtkInformation * outInfo)713 void vtkGESignaReader::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo)
714 {
715   vtkImageData* data = this->AllocateOutputData(output, outInfo);
716 
717   if (this->InternalFileName == nullptr)
718   {
719     vtkErrorMacro(<< "Either a FileName or FilePrefix must be specified.");
720     return;
721   }
722 
723   data->GetPointData()->GetScalars()->SetName("GESignalImage");
724 
725   this->ComputeDataIncrements();
726 
727   // Call the correct templated function for the output
728   void* outPtr;
729 
730   // Call the correct templated function for the input
731   outPtr = data->GetScalarPointer();
732   vtkGESignaReaderUpdate(this, data, (unsigned short*)(outPtr));
733 }
734 
735 //------------------------------------------------------------------------------
PrintSelf(ostream & os,vtkIndent indent)736 void vtkGESignaReader::PrintSelf(ostream& os, vtkIndent indent)
737 {
738   this->Superclass::PrintSelf(os, indent);
739 }
740