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