]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkReadMHDPlane.cxx
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #include "bbcreaVtkReadMHDPlane.h"
5 #include "bbcreaVtkPackage.h"
6
7 #include "stdio.h"
8
9
10 #define _LARGEFILE64_SOURCE
11
12 #include <stdio.h>
13 #include <sys/types.h>
14
15 #if defined(_WIN32)
16 #else
17 #include <unistd.h>
18 #endif // defined(_WIN32)
19
20 #include <stdlib.h>
21 #include <errno.h>
22 #include <string.h>
23 #include <sys/stat.h>
24 #include <fcntl.h>
25
26 namespace bbcreaVtk
27 {
28
29 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ReadMHDPlane)
30 BBTK_BLACK_BOX_IMPLEMENTATION(ReadMHDPlane,bbtk::AtomicBlackBox);
31 //===== 
32 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
33 //===== 
34
35
36 vtkImageData* ReadMHDPlane::CreateDefaultImage()
37 {
38         int i;
39         int sizeX, sizeY, sizeZ;
40         sizeX = 200;
41         sizeY = sizeX;
42         sizeZ = 1;
43         vtkImageData *newImage = vtkImageData::New();
44         newImage->Initialize();
45         newImage->SetSpacing( 1,1,1 );
46         newImage->SetDimensions(  sizeX,sizeY,sizeZ );
47         newImage->SetExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
48
49 //EED 2017-01-01 Migration VTK7
50 #if VTK_MAJOR_VERSION <= 5
51         newImage->SetWholeExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
52         newImage->SetScalarTypeToUnsignedChar();
53         newImage->SetNumberOfScalarComponents(1);
54         newImage->AllocateScalars();
55         newImage->Update();
56 #else
57         newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
58 #endif
59
60         memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 );
61         for (i=0; i<sizeX; i++)
62         {
63                 newImage->SetScalarComponentFromDouble(i,i,0, 0, 255 );
64                 newImage->SetScalarComponentFromDouble(i,sizeY-1-i,0, 0, 255 );
65         } // for i
66         return newImage;
67
68
69
70 void ReadMHDPlane::ReadNormalMHD()
71 {
72 // THE MAIN PROCESSING METHOD BODY
73 //   Here we simply set the input 'In' value to the output 'Out'
74 //   And print out the output value
75 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
76 //    void bbSet{Input|Output}NAME(const TYPE&)
77 //    const TYPE& bbGet{Input|Output}NAME() const 
78 //    Where :
79 //    * NAME is the name of the input/output
80 //      (the one provided in the attribute 'name' of the tag 'input')
81 //    * TYPE is the C++ type of the input/output
82 //      (the one provided in the attribute 'type' of the tag 'input')
83
84 //    bbSetOutputOut( bbGetInputIn() );
85 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
86
87         std::string inputfilename;
88         int slice;
89         int width;
90         long long dataSize;
91
92
93         if (bbGetInputDirectionPlane()=="XY")
94         {
95                 inputfilename=bbGetInputFileName();
96         } // if XY
97
98
99         if ((bbGetInputDirectionPlane()=="YZ") || (bbGetInputDirectionPlane()=="ZX"))
100         {
101                 //-- Split FileName
102                 std::size_t found               =       bbGetInputFileName().find_last_of("/\\");
103                 std::string path                =       bbGetInputFileName().substr(0,found+1);
104                 std::string filename    =       bbGetInputFileName().substr(found+1);
105 #ifdef _WIN32
106                 path=path+"YZ_ZX\\";
107 #else
108                 path=path+"YZ_ZX/";
109 #endif
110                 if (bbGetInputDirectionPlane()=="YZ") 
111                 { 
112                         inputfilename = path+filename+"_YZ.mhd";  
113                 } // if YZ
114
115                 if (bbGetInputDirectionPlane()=="ZX")
116                 {
117                         inputfilename = path+filename+"_ZX.mhd";
118                 } // XZ
119         } // if YZ || XZ
120
121         width = bbGetInputWidth();
122         if (width<=0 ) { width=1; }
123
124         slice = bbGetInputSlice();
125         if (slice<0 ) { slice=0; }
126
127         vtkImageData *newImage;
128         long long newHeaderSize;
129     std::string newFileName=inputfilename+"-OneSlice";
130
131     int sx,sy,sz;
132     char mystring[250];
133     char strTmp[20];
134         bool ok=true;
135     FILE *ffIn  = fopen(inputfilename.c_str(),"r");
136         if (ffIn!=NULL)
137         {
138             FILE *ffOut = fopen(newFileName.c_str(),"w");
139
140         while(!feof(ffIn))
141         {
142             strcpy(mystring,"\n");
143                         fgets(mystring,250,ffIn);
144                 if (strncmp("NDims",mystring,5)==0) 
145                         {
146                                 if (width==1) 
147                                 { 
148                                         strcpy(mystring,"NDims = 2\n"); 
149                                 } else {
150                                         strcpy(mystring,"NDims = 3\n"); 
151                                 }
152                         }
153                 if (strncmp("DimSize",mystring,6)==0) 
154                         {
155                                 sscanf(mystring,"%s %s %d %d %d",strTmp, strTmp, &sx, &sy,&sz);
156
157                                 if (width==1) 
158                                 { 
159                                         sprintf(mystring,"DimSize = %d %d\n",sx,sy);
160                                 } else {
161                                         sprintf(mystring,"DimSize = %d %d %d\n",sx,sy,width);
162                                 }
163
164                         newHeaderSize = (long long int)sx*(long long int)sy*(long long int)slice;
165                                 if (bbGetInputSlice()>=sz) {ok=false;}
166                         } // if
167                 if (strncmp("ElementType = MET_CHAR",mystring,22)==0)                   { dataSize=sizeof(char);                        }
168                 if (strncmp("ElementType = VTK_CHAR",mystring,22)==0)                   { dataSize=sizeof(char);                        }
169                 if (strncmp("ElementType = MET_UCHAR",mystring,23)==0)                  { dataSize=sizeof(unsigned char);       }
170                 if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0)  { dataSize=sizeof(unsigned char);       }
171                 if (strncmp("ElementType = MET_USHORT",mystring,24)==0)                 { dataSize=sizeof(unsigned short);      }
172                 if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { dataSize=sizeof(unsigned short);      }
173                 if (strncmp("ElementType = MET_SHORT",mystring,23)==0)                  { dataSize=sizeof(short);                       }
174                 if (strncmp("ElementType = VTK_SHORT",mystring,23)==0)                  { dataSize=sizeof(short);                       }
175                 if (strncmp("ElementType = MET_UINT",mystring,22)==0)                   { dataSize=sizeof(unsigned int);        }
176                 if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0)   { dataSize=sizeof(unsigned int);        }
177                 if (strncmp("ElementType = MET_INT",mystring,21)==0)                    { dataSize=sizeof(int);                         }
178                 if (strncmp("ElementType = VTK_INT",mystring,21)==0)                    { dataSize=sizeof(int);                         }
179                 if (strncmp("ElementType = MET_FLOAT",mystring,23)==0)                  { dataSize=sizeof(float);                       }
180                 if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0)                  { dataSize=sizeof(float);                       }
181                 if (strncmp("ElementType = MET_LONG",mystring,22)==0)                   { dataSize=sizeof(long);                        }
182                 if (strncmp("ElementType = VTK_LONG",mystring,22)==0)                   { dataSize=sizeof(long);                        }
183                 if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0)                 { dataSize=sizeof(double);                      }
184                 if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0)                 { dataSize=sizeof(double);                      }
185                         newHeaderSize=newHeaderSize*dataSize;
186
187                 if (strncmp("Offset",mystring,6)==0) {strcpy(mystring,"Offset = 0 0 0\n");}
188                 if (strncmp("HeaderSize",mystring,10)==0) {strcpy(mystring,"");}
189                 if (strncmp("ElementDataFile",mystring,15)==0) 
190                         {
191                                 fprintf(ffOut,"HeaderSize = %lld\n\n", newHeaderSize );
192                         } // if
193                 fprintf(ffOut,mystring); 
194         } // while
195                 fclose(ffIn);
196                 fclose(ffOut);
197
198                 if (ok==true)
199                 {
200                         vtkMetaImageReader * reader = vtkMetaImageReader::New();
201                         reader->SetFileName( newFileName.c_str() );
202                         reader->Update();
203                         newImage = reader->GetOutput();
204                 } // if ok
205         } else {
206                 ok=false;
207                 printf("EED ERROR: Problem openin:%s\n", inputfilename.c_str() );
208         }
209
210         if (ok==false)
211         {
212                 newImage=CreateDefaultImage();
213         } // if ok
214
215         bbSetOutputOut( newImage );
216 }
217
218
219
220
221
222 void ReadMHDPlane::Read64lseek()
223 {
224         int             slice;
225         int             width;
226
227         width = bbGetInputWidth();
228         if (width<=0 ) { width=1; }
229
230         slice = bbGetInputSlice();
231         if (slice<0 ) { slice=0; }
232
233         int             dimX=-1,dimY=-1,dimZ=-1;
234         int             dim=-1;
235         std::string formattype("VOID");
236         std::string elementdatafile("VOID");
237         float           spcX=-1,spcY=-1,spcZ=-1;
238         float           ox=-1,oy=-1,oz=-1;
239         long int        headersize=0;
240
241         vtkImageData *newImage=NULL;
242         int imageType;
243
244         char mystring[250];
245         char strTmp[30];
246         char strTmp2[30];
247         FILE *ffIn      = fopen(bbGetInputFileName().c_str(),"r");
248         long long dataSize;
249
250         if (ffIn!=NULL)
251         {
252                 newImage = vtkImageData::New();
253
254                 while(!feof(ffIn))
255                 {
256             strcpy(mystring,"\n");
257                         fgets(mystring,250,ffIn);
258                 if (strncmp("NDims",mystring,5)==0)                     { sscanf(mystring,"%s %s %d"            ,strTmp, strTmp, &dim);                                 }
259                 if (strncmp("DimSize",mystring,6)==0)                   { sscanf(mystring,"%s %s %d %d %d"      ,strTmp, strTmp, &dimX, &dimY,&dimZ);   } 
260                         if (strncmp("ElementType",mystring,11)==0)              { sscanf(mystring,"%s %s %s"            ,strTmp, strTmp, strTmp2); formattype=strTmp2;                  }
261                         if (strncmp("ElementSpacing",mystring,14)==0)   { sscanf(mystring,"%s %s %f %f %f"      ,strTmp, strTmp, &spcX,&spcY,&spcZ);    }
262                         if (strncmp("ElementSize",mystring,11)==0)              { sscanf(mystring,"%s %s %f %f %f"      ,strTmp, strTmp, &spcX,&spcY,&spcZ);    }
263                 if (strncmp("Offset",mystring,6)==0)                    { sscanf(mystring,"%s %s %f %f %f"      ,strTmp, strTmp, &ox, &oy, &oz);                }
264                 if (strncmp("HeaderSize",mystring,10)==0)               { sscanf(mystring,"%s %s %ld"           ,strTmp, strTmp, &headersize);                  }
265                         if (strncmp("ElementDataFile",mystring,15)==0)  { sscanf(mystring,"%s %s %s"            ,strTmp, strTmp, strTmp2); elementdatafile=strTmp2;             }
266
267
268
269                         if (strncmp("ElementType = MET_CHAR",mystring,22)==0)                   { imageType =VTK_CHAR;                   dataSize=sizeof(char);                  }
270                         if (strncmp("ElementType = VTK_CHAR",mystring,22)==0)                   { imageType =VTK_CHAR;                   dataSize=sizeof(char);                  }
271                         if (strncmp("ElementType = MET_UCHAR",mystring,23)==0)                  { imageType =VTK_UNSIGNED_CHAR;  dataSize=sizeof(unsigned char); }
272                         if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0)  { imageType =VTK_UNSIGNED_CHAR;  dataSize=sizeof(unsigned char); }
273                         if (strncmp("ElementType = MET_USHORT",mystring,24)==0)                 { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
274                         if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
275                         if (strncmp("ElementType = MET_SHORT",mystring,23)==0)                  { imageType =VTK_SHORT;                  dataSize=sizeof(short);                 }
276                         if (strncmp("ElementType = VTK_SHORT",mystring,23)==0)                  { imageType =VTK_SHORT;                  dataSize=sizeof(short);                 }
277                         if (strncmp("ElementType = MET_UINT",mystring,22)==0)                   { imageType =VTK_UNSIGNED_INT;   dataSize=sizeof(unsigned int);  }
278                         if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0)   { imageType =VTK_UNSIGNED_INT;   dataSize=sizeof(unsigned int);  }
279                         if (strncmp("ElementType = MET_INT",mystring,21)==0)                    { imageType =VTK_INT;                    dataSize=sizeof(int);                   }
280                         if (strncmp("ElementType = VTK_INT",mystring,21)==0)                    { imageType =VTK_INT;                    dataSize=sizeof(int);                   }
281                         if (strncmp("ElementType = MET_FLOAT",mystring,23)==0)                  { imageType =VTK_FLOAT;                  dataSize=sizeof(float);                 }
282                         if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0)                  { imageType =VTK_FLOAT;                  dataSize=sizeof(float);                 }
283                         if (strncmp("ElementType = MET_LONG",mystring,22)==0)                   { imageType =VTK_LONG;                   dataSize=sizeof(long);                  }
284                         if (strncmp("ElementType = VTK_LONG",mystring,22)==0)                   { imageType =VTK_LONG;                   dataSize=sizeof(long);                  }
285                         if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0)                 { imageType =VTK_DOUBLE;                 dataSize=sizeof(double);                }
286                         if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0)                 { imageType =VTK_DOUBLE;                 dataSize=sizeof(double);                }
287
288         } // while
289                 fclose(ffIn);
290
291                 newImage->Initialize();
292
293
294                 int             fd;
295                 long long       ret;
296                 std::size_t found;
297                 std::string filename;
298                 found                                   = bbGetInputFileName().find_last_of("/\\");
299                 filename                                = bbGetInputFileName().substr(0,found+1) + elementdatafile ;
300                 long long       pos;
301
302                 long long lsize                 = dimX*dimY*width *dataSize;
303
304
305 #if defined(_WIN32)
306                    _sopen_s( &fd, filename.c_str(), _O_RDONLY, _SH_DENYNO, 0 );
307 #else
308                 fd = open ( filename.c_str() ,  O_RDONLY|O_LARGEFILE );
309 #endif // defined(_WIN32)
310
311
312                 if (fd < 0)
313                 {
314                         printf("EED ReadMHDPlane::Read64lseek   WARNNING! raw file not exist\n");
315                         fprintf(stderr, "%s\n", strerror(errno));
316                         newImage=CreateDefaultImage();
317 //                      exit(1);
318                 }       
319                 
320
321                 if ((bbGetInputDirectionPlane()=="XY") && (fd>=0)) 
322                 { 
323                         newImage->SetSpacing( spcX,spcY,spcZ );
324                         newImage->SetDimensions(  dimX,dimY,width );
325                         newImage->SetExtent(0,  dimX-1,0,dimY-1,0,width-1 );
326
327 //EED 2017-01-01 Migration VTK7
328 #if VTK_MAJOR_VERSION <= 5
329                         newImage->SetWholeExtent(0,  dimX-1,0,dimY-1,0,width-1 );
330                         newImage->SetNumberOfScalarComponents(1);
331                         newImage->SetScalarType(imageType);
332                         newImage->AllocateScalars();
333                         newImage->Update();
334 #else
335                         newImage->AllocateScalars( imageType,1 );
336 #endif
337
338
339                         pos = dimX*dimY*(long long)slice*dataSize;
340 #if defined(_WIN32)
341                         if (_lseeki64( fd, pos, SEEK_SET ) < 0)
342 #else
343                         if (lseek64(fd, pos, SEEK_SET) < 0) 
344 #endif // defined(_WIN32)
345                         {
346                                 printf("EED ReadMHDPlane::Read64lseek \n");
347                                 fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
348                                 exit(1);
349                         }
350
351                         if ((ret = read(fd, newImage->GetScalarPointer() , lsize)) < 0) 
352                         {
353                                 fprintf(stderr, "Failed reading: %s\n", strerror(errno));
354                                 exit(1);
355                         }
356                 }  // if PLANE XY
357
358                 if ((bbGetInputDirectionPlane()=="XZ") && (fd>=0))
359                 { 
360                         newImage->SetSpacing( spcX,spcZ,spcY );
361                         newImage->SetDimensions(  dimX,dimZ,width );
362                         newImage->SetExtent(0,  dimX-1,0,dimZ-1,0,width-1 );
363 //EED 2017-01-01 Migration VTK7
364 #if VTK_MAJOR_VERSION <= 5
365                         newImage->SetWholeExtent(0,  dimX-1,0,dimZ-1,0,width-1 );
366                         newImage->SetNumberOfScalarComponents(1);
367                         newImage->SetScalarType(imageType);
368                         newImage->AllocateScalars();
369                         newImage->Update();
370 #else
371                         newImage->AllocateScalars( imageType, 1);
372 #endif
373
374                         int iWidth;
375                         for (iWidth=0;iWidth<width;iWidth++)
376                         {
377                                 copy_XZ_plane(fd,newImage,slice+iWidth,iWidth,dimX,dimY,dimZ,dataSize);
378                         }
379                 }  // if PLANE XZ
380
381                 if ((bbGetInputDirectionPlane()=="YZ") && (fd>=0))
382                 { 
383                         newImage->SetSpacing( spcY,spcZ,spcX );
384                         newImage->SetDimensions(  dimY,dimZ,width );
385                         newImage->SetExtent(0,  dimY-1,0,dimZ-1,0,width-1 );
386 //EED 2017-01-01 Migration VTK7
387 #if VTK_MAJOR_VERSION <= 5
388                         newImage->SetWholeExtent(0,  dimY-1,0,dimZ-1,0,width-1 );
389                         newImage->SetNumberOfScalarComponents(1);
390                         newImage->SetScalarType(imageType);
391                         newImage->AllocateScalars();
392                         newImage->Update();
393 #else
394                         newImage->AllocateScalars( imageType ,1 );
395 #endif
396
397                         int iWidth;
398                         for (iWidth=0;iWidth<width;iWidth++)
399                         {
400                                 copy_YZ_plane(fd,newImage,slice+iWidth,iWidth,dimX,dimY,dimZ,dataSize);
401                         }
402
403                 }  // if PLANE YZ       
404 #if defined(_WIN32)
405                 _close (fd);
406 #else
407                 close (fd);
408 #endif // defined(_WIN32)
409         } else {
410                 newImage=CreateDefaultImage();
411         } // if  ffIn
412
413         bbSetOutputOut( newImage );
414 }
415
416
417 void ReadMHDPlane::copy_YZ_plane(int fd,vtkImageData *newImage,int slice,int iWidth,int dimX,int dimY,int dimZ,int dataSize)
418 {
419         long long int j;
420         long long int i;
421         long long       ret;
422         long long       pos;
423         long long sizeBytesPlane = dimX*dimY*dataSize;
424         char *pImage;
425         for (j=0;j<dimZ;j++)
426         {
427                 for (i=0;i<dimY;i++)
428                 {
429                         pos = ((long long int)slice+iWidth + i*dimX + j*dimX*dimY)*dataSize ;
430 #if defined(_WIN32)
431                         if (_lseeki64( fd, pos , SEEK_SET ) < 0)
432 #else
433                         if (lseek64(fd, pos , SEEK_SET) < 0) 
434 #endif // defined(_WIN32)
435                         {
436                                 printf("EED ReadMHDPlane::Read64lseek \n");
437                                 fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
438                                 exit(1);
439                         }
440
441                         pImage=(char*)(newImage->GetScalarPointer(i, dimZ-1-j,iWidth ));
442                         if ((ret = read(fd, pImage , dataSize)) < 0) 
443                         {
444                                 fprintf(stderr, "Failed reading: %s\n", strerror(errno));
445                                 exit(1);
446                         }
447                         } // for i
448                 } // for j
449 }
450
451
452 void ReadMHDPlane::copy_XZ_plane(int fd,vtkImageData *newImage,int slice,int iWidth,int dimX,int dimY,int dimZ,int dataSize)
453 {
454         long long int j;
455         long long       ret;
456         long long       pos;
457         pos = dimX*(long long int)slice*dataSize;
458         long long sizeBytesPlane = dimX*dimY*dataSize;
459         char *pImage = (char*)( newImage->GetScalarPointer(0,0,iWidth) );
460         for (j=dimZ-1;j>=0;j--)
461         {
462 #if defined(_WIN32)
463                 if (_lseeki64( fd, pos + j*sizeBytesPlane , SEEK_SET ) < 0)
464 #else
465                 if (lseek64(fd, pos + j*sizeBytesPlane , SEEK_SET) < 0) 
466 #endif // defined(_WIN32)
467                 {
468                         printf("EED ReadMHDPlane::Read64lseek \n");
469                         fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
470                         exit(1);
471                 }
472
473                 if ((ret = read(fd, pImage , dimX*dataSize)) < 0) 
474                 {
475                         fprintf(stderr, "Failed reading: %s\n", strerror(errno));
476                         exit(1);
477                 }
478                 pImage = pImage+dimX*dataSize;
479         } // for j
480 }
481
482
483
484 void ReadMHDPlane::Process()
485 {
486         if (bbGetInputType()==0)
487         {
488                 ReadNormalMHD();
489         }       
490
491         if (bbGetInputType()==1)
492         {
493                 Read64lseek();
494         }       
495
496 }
497 //===== 
498 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
499 //===== 
500 void ReadMHDPlane::bbUserSetDefaultValues()
501 {
502
503 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
504 //    Here we initialize the input 'In' to 0
505    bbSetInputFileName("");
506    bbSetInputSlice(0);
507    bbSetInputType(1);
508    bbSetInputWidth(1);
509    bbSetInputDirectionPlane("XY");
510   
511 }
512 //===== 
513 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
514 //===== 
515 void ReadMHDPlane::bbUserInitializeProcessing()
516 {
517
518 //  THE INITIALIZATION METHOD BODY :
519 //    Here does nothing 
520 //    but this is where you should allocate the internal/output pointers 
521 //    if any 
522
523   
524 }
525 //===== 
526 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
527 //===== 
528 void ReadMHDPlane::bbUserFinalizeProcessing()
529 {
530
531 //  THE FINALIZATION METHOD BODY :
532 //    Here does nothing 
533 //    but this is where you should desallocate the internal/output pointers 
534 //    if any
535   
536 }
537 }
538 // EO namespace bbcreaVtk
539
540