marDicomBase.cpp

Go to the documentation of this file.
00001 
00002 #include "marDicomBase.h"
00003 
00004 #include <vtkVolume16Reader.h> 
00005 #include <vtkExtractVOI.h>
00006 #include <vtkImageChangeInformation.h>
00007 #include "vtkMetaImageWriter.h"
00008 
00009 
00010 
00011 marFilesBase::marFilesBase( marParameters* p  ) :  marObject( p ) {
00012         _volume=NULL;
00013 }
00014 // -------------------------------------------------------------------------
00015 marFilesBase::~marFilesBase(){
00016         freeVolume( );
00017 }
00018 // -------------------------------------------------------------------------
00019 kVolume* marFilesBase::getVolume( ){
00020         return( _volume );
00021 }
00022 // -------------------------------------------------------------------------
00023 void marFilesBase::SetVolume( kVolume* volume  ){
00024         _volume=volume;
00025 }
00026 // -------------------------------------------------------------------------
00027 bool marFilesBase::volumeLoaded( ){
00028         return( _volume != NULL );
00029 }
00030 // -------------------------------------------------------------------------
00031 void marFilesBase::freeVolume( ){
00032         if( _volume ) delete _volume;
00033         _volume = NULL;
00034 }
00035 
00036 
00037 // -------------------------------------------------------------------------
00038 
00039 std::vector < std::string*>  *marFilesBase::GetListImages()
00040 {
00041         return &_lstString;
00042 }
00043 
00044 // -------------------------------------------------------------------------
00045 void marFilesBase::CleanListImages()
00046 {
00047         int i,size;
00048         size=this->_lstString.size();
00049         for(i=0;i<size;i++)
00050         {
00051                 delete _lstString[i];
00052         }
00053         _lstString.clear();
00054 }
00055 
00056 
00057 // -------------------------------------------------------------------------
00058 void marFilesBase::ResetLstFileNotReaded()
00059 {
00060         _lstFileNotReaded.clear();
00061 }
00062 
00063 
00064 // -------------------------------------------------------------------------
00065 std::string marFilesBase::GetMsgLstFile()
00066 {
00067         int i,sizeLst;
00068 //EEDx44
00069         std::string msgLstFile="";
00070         sizeLst=_lstFileNotReaded.size();
00071         for (i=0;i<sizeLst;i++)
00072         {
00073                 msgLstFile = msgLstFile + *(_lstFileNotReaded[i]) ;
00074                 msgLstFile = msgLstFile + "\n";
00075         }
00076 
00077         return msgLstFile;
00078 }
00079 
00080 
00081 
00082 
00083 
00084 
00085 // -------------------------------------------------------------------------
00086 // -------------------------------------------------------------------------
00087 // -------------------------------------------------------------------------
00088 marRAWFiles::marRAWFiles(marParameters* p)
00089 :  marFilesBase(p)
00090 {
00091         _littreEndianBigEndian=0;
00092 }
00093 // -------------------------------------------------------------------------
00094 marRAWFiles::~marRAWFiles()
00095 {
00096 }
00097 // -------------------------------------------------------------------------
00098 //EED 9 oct 2006
00099 bool marRAWFiles::loadImage(int i) // virtual
00100 {
00101 
00102         int dim[3];
00103 
00104         vtkImageData *vol = getVolume( )->castVtk();
00105         void *p_vol=(void*)getVolume( )->castVtk()->GetScalarPointer(0,0,i);
00106         vol->GetDimensions(dim);
00107 
00108         int dataSize = sizeof(unsigned short)*dim[0]*dim[1];
00109         bool ok=true;
00110 
00111 /*
00112         std::string *ss = _lstString[i];
00113         FILE *ff=fopen( (char*)(ss->c_str())  , "r+" );
00114         fread( (char*)p_vol , dataSize,1, ff);
00115         fclose(ff);
00116 */
00117 
00118         std::string *ss = _lstString[i];
00119         vtkVolume16Reader *reader = vtkVolume16Reader::New ();
00120         reader->SetDataDimensions ( dim[0] , dim[1] );
00121         if (_littreEndianBigEndian == 0) {
00122             reader->SetDataByteOrderToLittleEndian ( );
00123         } else {
00124                 reader->SetDataByteOrderToBigEndian();
00125         }
00126         reader->SetFilePrefix ( (char*)(ss->c_str())  );
00127         reader->SetFilePattern("%s");
00128     reader->SetImageRange ( 0, 0 );
00129     reader->SetDataSpacing ( 1, 1, 1 );
00130     reader->Update ();
00131         void *pp_vol=(void*)reader->GetOutput()->GetScalarPointer(0,0,0);
00132         memcpy(p_vol,pp_vol,dataSize);
00133         reader->Delete();
00134 
00135 
00136 /*
00137 
00138         std::string *ss = _lstString[i];
00139         vtkGsmisReader *reader = vtkGsmisReader::New();
00140         reader->SetFileName( (char*)(ss->c_str())  );
00141         vtkImageData *ima=reader->GetOutput();
00142         ima->Update();
00143         void *pp_vol=(void*)ima->GetScalarPointer(0,0,0);
00144         memcpy(p_vol,pp_vol,dataSize);
00145 //      reader->Delete();
00146 */
00147 
00148 
00149 
00150 /*
00151         int             ii;
00152         char    tmp;
00153         char    *pp = (char*)p_vol;
00154         unsigned short   *valueA;
00155         dataSize        = dim[0]*dim[1];
00156         for (ii=0;ii<dataSize;ii++)
00157         {
00158                 tmp             = *pp;
00159                 *pp             = *(pp+1);
00160                 *(pp+1) = tmp;
00161 
00162                 valueA=(unsigned short*)pp;
00163                 *valueA=*valueA-32000;
00164                 if (*valueA>=32000)
00165                 {
00166                         *valueA=0;
00167                 } 
00168 
00169                 pp              = pp+2;
00170         }
00171 */
00172 
00173         if (ok==false) {
00174                 _lstFileNotReaded.push_back( (char*)(ss->c_str()) );
00175         }
00176 
00177         return ok;
00178 }
00179 // -------------------------------------------------------------------------
00180 //EED 9 oct 2006
00181 void marRAWFiles::loadActualSerie(wxGauge* gauge )
00182 {
00183 
00184         // Read File List
00185         FILE *ff;
00186         ff = fopen( _lstString[0] -> c_str() , "r"); 
00187         std::string directory(*(_lstString[1]) );
00188         char tmp[255];
00189 
00190         fscanf(ff,"%s",tmp);
00191         fscanf(ff,"%s",tmp);
00192         //int type =    atoi(tmp);  // 0 // JPRx
00193 
00194         fscanf(ff,"%s",tmp);
00195         fscanf(ff,"%s",tmp);
00196         int wx  =       atoi(tmp);
00197         fscanf(ff,"%s",tmp);
00198         fscanf(ff,"%s",tmp);
00199         int wy  =       atoi(tmp);
00200 
00201         fscanf(ff,"%s",tmp);
00202         fscanf(ff,"%s",tmp);
00203         double spx      =       atof(tmp);
00204         fscanf(ff,"%s",tmp);
00205         fscanf(ff,"%s",tmp);
00206         double spy      =       atof(tmp);
00207         fscanf(ff,"%s",tmp);
00208         fscanf(ff,"%s",tmp);
00209         double spz      =       atof(tmp);
00210 
00211         fscanf(ff,"%s",tmp);
00212         fscanf(ff,"%s",tmp);
00213         int LB  =       atoi(tmp);
00214 
00215         this->SetLittreEndianBigEndian(LB);
00216 
00217 
00218         int wz=0;
00219         this->CleanListImages();
00220         while ( !feof(ff) )
00221         {
00222                 fscanf(ff,"%s",tmp);
00223                 std::string *tmpStr =  new std::string(tmp);
00224                 (*tmpStr) = "/"+(*tmpStr);
00225                 (*tmpStr) = (directory)+(*tmpStr);
00226                 _lstString.push_back( tmpStr);
00227                 wz++;
00228         }
00229 
00230         fclose(ff);
00231 
00232 
00233         // Create Free Memory block image
00234         freeVolume();
00235 
00236         if (wz==0)
00237         {
00238                 wz=1;
00239         }
00240 
00241         kVolume *vol =new kVolume( kVolume::USHORT, wx, wy, wz,spx, spy, spz, malloc(sizeof(unsigned short)*wx*wy*wz ) );
00242         SetVolume( vol );
00243 
00244 
00245         // Define Spacing
00246         getParameters( )->setDoubleParam( marParameters::e_voxel_x_dimension, spx );
00247         getParameters( )->setDoubleParam( marParameters::e_voxel_y_dimension, spy );
00248         getParameters( )->setDoubleParam( marParameters::e_voxel_z_dimension, spz );
00249 
00250         // Define Intercept Slope
00251         getParameters( )->setDoubleParam( marParameters::e_RescaleIntercept , 0 );
00252         getParameters( )->setDoubleParam( marParameters::e_RescaleSlope     , 1 );
00253 }
00254 // -------------------------------------------------------------------------
00255 void marRAWFiles::SetLittreEndianBigEndian(int value)
00256 {
00257         _littreEndianBigEndian = value;
00258 }
00259 // -------------------------------------------------------------------------
00260 int     marRAWFiles::GetLittreEndianBigEndian()
00261 {
00262         return _littreEndianBigEndian;
00263 }
00264 // -------------------------------------------------------------------------
00265 void marRAWFiles::reset( )
00266 {
00267 }
00268 // -------------------------------------------------------------------------
00269 void marRAWFiles::copyFrom( const marObject& from )
00270 {
00271 }
00272 // -------------------------------------------------------------------------
00273 bool marRAWFiles::save( std::ofstream& os )
00274 {
00275         return true;
00276 }
00277 // -------------------------------------------------------------------------
00278 bool marRAWFiles::load( std::ifstream& is )
00279 {
00280         return true;
00281 }
00282 
00283 
00284 //-------------------------------------------------------------------------
00285 // -------------------------------------------------------------------------
00286 // -------------------------------------------------------------------------
00287 marRAW2AsciiFiles::marRAW2AsciiFiles(marParameters* p)
00288 :  marRAWFiles(p)
00289 {
00290 }
00291 // -------------------------------------------------------------------------
00292 marRAW2AsciiFiles::~marRAW2AsciiFiles()
00293 {
00294 }
00295 // -------------------------------------------------------------------------
00296 bool marRAW2AsciiFiles::loadImage(int i) // virtual
00297 {
00298         return true;
00299 }
00300 
00301 
00302 // -------------------------------------------------------------------------
00303 //EED 9 oct 2006
00304 void marRAW2AsciiFiles::loadActualSerie(wxGauge* gauge )
00305 {
00306 
00307         // Read File List
00308         FILE *ff;
00309         ff = fopen( _lstString[0] -> c_str() , "r"); 
00310         char tmp[255];
00311 
00312         // type
00313         fscanf(ff,"%s",tmp);
00314         fscanf(ff,"%s",tmp);
00315         //int type =    atoi(tmp);  // 300  // JPRx
00316 
00317         //size x,y,z
00318         fscanf(ff,"%s",tmp);
00319         fscanf(ff,"%s",tmp);
00320         int wx  =       atoi(tmp);
00321         fscanf(ff,"%s",tmp);
00322         fscanf(ff,"%s",tmp);
00323         int wy  =       atoi(tmp);
00324         fscanf(ff,"%s",tmp);
00325         fscanf(ff,"%s",tmp);
00326         int wz  =       atoi(tmp);
00327 
00328         // spacing x,y,z
00329         fscanf(ff,"%s",tmp);
00330         fscanf(ff,"%s",tmp);
00331         double spx      =       atof(tmp);
00332         fscanf(ff,"%s",tmp);
00333         fscanf(ff,"%s",tmp);
00334         double spy      =       atof(tmp);
00335         fscanf(ff,"%s",tmp);
00336         fscanf(ff,"%s",tmp);
00337         double spz      =       atof(tmp);
00338 
00339         // Intercept Slope
00340         fscanf(ff,"%s",tmp);
00341         fscanf(ff,"%s",tmp);
00342         double intercept        =       atof(tmp);
00343         fscanf(ff,"%s",tmp);
00344         fscanf(ff,"%s",tmp);
00345         double slope            =       atof(tmp);
00346 
00347 
00348         fscanf(ff,"%s",tmp);
00349         std::string file(tmp);
00350         std::string namefile( *_lstString[1] );  // directory
00351         namefile=namefile+"/";                   // +  
00352         namefile=namefile+file;                  // file
00353 
00354         fclose(ff);
00355 
00356 
00357         this->CleanListImages();
00358 
00359         // Create Free Memory block image
00360         freeVolume();
00361 
00362         if (wz==0)
00363         {
00364                 wz=1;
00365         }
00366 
00367         kVolume *vol =new kVolume( kVolume::USHORT, wx, wy, wz,spx, spy, spz, malloc(sizeof(unsigned short)*wx*wy*wz ) );
00368         SetVolume( vol );
00369 
00370 
00371         // Define Spacing
00372         getParameters( )->setDoubleParam( marParameters::e_voxel_x_dimension, spx );
00373         getParameters( )->setDoubleParam( marParameters::e_voxel_y_dimension, spy );
00374         getParameters( )->setDoubleParam( marParameters::e_voxel_z_dimension, spz );
00375 
00376         // Define Intercept Slope
00377         getParameters( )->setDoubleParam( marParameters::e_RescaleIntercept , 0 );
00378         getParameters( )->setDoubleParam( marParameters::e_RescaleSlope     , 1 );
00379 
00380 
00381         void    *p_vol  = (void*)getVolume( )->castVtk()->GetScalarPointer(0,0,0);
00382         short   *pp             = (short*)p_vol;
00383 
00384         FILE *fff=fopen( (char*)namefile.c_str() , "r+" );
00385         long int ii, dataSize   = wx*wy*wz;
00386         float value;
00387         for (ii=0;ii<dataSize;ii++)
00388         {
00389                 fscanf(fff,"%f ",&value);
00390                 // Intercept Slope
00391                 *pp     = (short)        ( value*slope + intercept );
00392                 if (*pp<0)
00393                 {
00394                         *pp=0;
00395                 } 
00396                 pp++;
00397         }
00398         fclose(fff);
00399 
00400 
00401 // Y- Flip
00402 //      FlipY( getVolume( )->castVtk() );
00403         
00404 }
00405 
00406 
00407 // -------------------------------------------------------------------------
00408 // -------------------------------------------------------------------------
00409 // -------------------------------------------------------------------------
00410 marRAW2Files::marRAW2Files(marParameters* p)
00411 :  marRAWFiles(p)
00412 {
00413 }
00414 // -------------------------------------------------------------------------
00415 marRAW2Files::~marRAW2Files()
00416 {
00417 }
00418 // -------------------------------------------------------------------------
00419 bool marRAW2Files::loadImage(int i) // virtual
00420 {
00421         return true;
00422 }
00423 
00424 
00425 // -------------------------------------------------------------------------
00426 //EED 9 oct 2006
00427 void marRAW2Files::loadActualSerie(wxGauge* gauge )
00428 {
00429 
00430         // Read File List
00431         FILE *ff;
00432         ff = fopen( _lstString[0] -> c_str() , "r"); 
00433         char tmp[255];
00434 
00435         // type
00436         fscanf(ff,"%s",tmp);
00437         fscanf(ff,"%s",tmp);
00438         //int type =    atoi(tmp);  // 200  // JPRx
00439 
00440         //size x,y,z
00441         fscanf(ff,"%s",tmp);
00442         fscanf(ff,"%s",tmp);
00443         int wx  =       atoi(tmp);
00444         fscanf(ff,"%s",tmp);
00445         fscanf(ff,"%s",tmp);
00446         int wy  =       atoi(tmp);
00447 //      fscanf(ff,"%s",tmp);
00448 //      fscanf(ff,"%s",tmp);
00449 //      int wz  =       atoi(tmp);
00450 
00451         fscanf(ff,"%s",tmp);
00452         fscanf(ff,"%s",tmp);
00453         int wz1 =       atoi(tmp);
00454         fscanf(ff,"%s",tmp);
00455         fscanf(ff,"%s",tmp);
00456         int wz2 =       atoi(tmp);
00457 
00458         int wz = wz2-wz1;
00459         
00460         // spacing x,y,z
00461         fscanf(ff,"%s",tmp);
00462         fscanf(ff,"%s",tmp);
00463         double spx      =       atof(tmp);
00464         fscanf(ff,"%s",tmp);
00465         fscanf(ff,"%s",tmp);
00466         double spy      =       atof(tmp);
00467         fscanf(ff,"%s",tmp);
00468         fscanf(ff,"%s",tmp);
00469         double spz      =       atof(tmp);
00470 
00471         // Intercept Slope
00472         fscanf(ff,"%s",tmp);
00473         fscanf(ff,"%s",tmp);
00474         double intercept        =       atof(tmp);
00475         fscanf(ff,"%s",tmp);
00476         fscanf(ff,"%s",tmp);
00477         double slope            =       atof(tmp);
00478 
00479         // L/B
00480         fscanf(ff,"%s",tmp);
00481         fscanf(ff,"%s",tmp);
00482         int littleBig   =       atoi(tmp);
00483 
00484         // bits
00485         fscanf(ff,"%s",tmp);
00486         fscanf(ff,"%s",tmp);
00487         int bits        =       atoi(tmp);
00488 
00489         if ((bits!=8) && (bits!=16)){
00490                 bits=16;
00491         }
00492         
00493         fscanf(ff,"%s",tmp);
00494         std::string file(tmp);
00495         std::string namefile( *_lstString[1] );  // directory
00496         namefile=namefile+"/";                   // +  
00497         namefile=namefile+file;                  // file
00498 
00499         fclose(ff);
00500 
00501 
00502         this->CleanListImages();
00503 
00504         // Create Free Memory block image
00505         freeVolume();
00506 
00507         if (wz==0)
00508         {
00509                 wz=1;
00510         }
00511 
00512 
00513         kVolume *vol =new kVolume( kVolume::USHORT, wx, wy, wz,spx, spy, spz, malloc(sizeof(unsigned short)*wx*wy*wz ) );
00514         SetVolume( vol );
00515 
00516 
00517         // Define Spacing
00518         getParameters( )->setDoubleParam( marParameters::e_voxel_x_dimension, spx );
00519         getParameters( )->setDoubleParam( marParameters::e_voxel_y_dimension, spy );
00520         getParameters( )->setDoubleParam( marParameters::e_voxel_z_dimension, spz );
00521 
00522         // Define Intercept Slope
00523         getParameters( )->setDoubleParam( marParameters::e_RescaleIntercept , 0 );
00524         getParameters( )->setDoubleParam( marParameters::e_RescaleSlope     , 1 );
00525 
00526         void *p_vol=(void*)getVolume( )->castVtk()->GetScalarPointer(0,0,0);
00527         FILE *fff=fopen( (char*)namefile.c_str() , "r+" );
00528     if (bits==16)
00529     {
00530                 fseek( fff , wx*wy*wz1*2 , SEEK_CUR );
00531         fread( (char*)p_vol , wx*wy*wz*2,1, fff);
00532             fclose(fff);
00533 
00534 
00535         // littleBigEndien
00536                 if (littleBig==1){
00537                         long int                ii;
00538                         char                    tmpB;
00539                         char                    *pp = (char*)p_vol;
00540                         unsigned short   *valueA;
00541                         long int dataSize       = wx*wy*wz;
00542                         for (ii=0;ii<dataSize;ii++)
00543                         {
00544                                 tmpB            = *pp;
00545                                 *pp                     = *(pp+1);
00546                                 *(pp+1)         = tmpB;
00547                                 
00548                                 valueA= ((unsigned short*)pp);
00549                                 if (*valueA>=32000)
00550                                 {
00551                                         *valueA=0;
00552                                 } 
00553                                 pp              = pp+2;
00554 
00555                         }
00556                 }
00557 
00558                 unsigned short                  *pp = (unsigned short*)p_vol;
00559                 int tmpInt;
00560                 int ii, dataSize        = wx*wy*wz;
00561                 for (ii=0;ii<dataSize;ii++)
00562                 {
00563                         tmpInt = (int) (*pp);
00564                         tmpInt  = (int)  ( tmpInt*slope+intercept );
00565                         if (tmpInt<0)
00566                         {
00567                                 tmpInt=0;
00568                         } 
00569                         if (tmpInt>65535) 
00570                         {
00571                                 tmpInt=65535;
00572                         }
00573                         (*pp) = (unsigned short)tmpInt;
00574                         pp              = pp+1;
00575                 }
00576 
00577     } else {
00578         unsigned short *pShort=(unsigned short*)p_vol;
00579         int i8bitImage,size8bitImage = wx*wy*wz;
00580         unsigned char *pChar=(unsigned char*)malloc( size8bitImage );
00581                 fseek( fff , wx*wy*wz1 , SEEK_CUR );
00582         fread( (unsigned char*)pChar , size8bitImage,1, fff);
00583             fclose(fff);
00584                 double tmpDouble;
00585         for ( i8bitImage=0 ; i8bitImage < size8bitImage ; i8bitImage++ )
00586         {
00587                         
00588                         tmpDouble=(float)pChar[ i8bitImage ];
00589                         tmpDouble=tmpDouble*slope+intercept;
00590                         if (tmpDouble<0)
00591                         {
00592                                 tmpDouble=0;
00593                         } 
00594                 pShort[ i8bitImage ] = (unsigned short)tmpDouble;
00595         }
00596         free (pChar);
00597     }
00598 
00599 // Y- Flip
00600         FlipY( getVolume( )->castVtk() );
00601         
00602 }
00603 
00604 
00605 
00606 
00607 // -------------------------------------------------------------------------
00608 void marRAW2Files::FlipY(vtkImageData *imagedata)
00609 {
00610         vtkImageData *vtkimagedata = imagedata;
00611         vtkimagedata->Update();
00612         int dim[3];
00613         vtkimagedata->GetDimensions(dim);
00614         unsigned short tmp;
00615         unsigned short *pp=(unsigned short*)vtkimagedata->GetScalarPointer(0,0,0);
00616         int xx,yy,zz;
00617         int sizeX  = dim[0];
00618         int sizeY  = dim[1];
00619         int sizeY2 = sizeY/2;
00620         int sizeZ  = dim[2];
00621         long int deltaZ;
00622         long int deltaA;
00623         long int deltaB;
00624 
00625         for ( zz=0 ; zz<sizeZ ; zz++ )
00626         {
00627                 deltaZ=zz*sizeX*sizeY;
00628                 for ( xx=0 ; xx<sizeX ; xx++ )
00629                 {
00630                 for ( yy=0 ; yy<sizeY2 ; yy++ )
00631                         {
00632                                 deltaA          = xx + yy*sizeX + deltaZ;
00633                                 deltaB          = xx + (sizeY-yy-1)*sizeX + deltaZ;
00634                                 tmp                     = pp[deltaA ];
00635                                 pp[deltaA]      = pp[deltaB ];
00636                                 pp[deltaB]      = tmp;
00637                                 }
00638                         }
00639                 }
00640    vtkimagedata->Update();
00641 
00642 }
00643 // -------------------------------------------------------------------------
00644 
00645 // EED 23 Janvier 2007
00646 void marRAW2Files::saveVolume( std::string directory, std::string name, vtkImageData *imagedata,int voi[6], double slope, double intercept) // virtual
00647 {
00648 
00649         std::string filename             = directory+"/"+name;
00650 
00651                 // Crop
00652         vtkExtractVOI *crop = vtkExtractVOI::New();
00653         crop->SetInput( imagedata );
00654         crop->SetVOI( voi );
00655         crop->Update();
00656 
00657         int dim[3];
00658         int ext[6];
00659         double spc[3];
00660         crop->GetOutput()->GetDimensions(dim);
00661         crop->GetOutput()->GetSpacing(spc);
00662         crop->GetOutput()->GetExtent(ext);
00663 
00664 
00665         vtkImageChangeInformation* change = vtkImageChangeInformation::New();
00666         change->SetInput( crop->GetOutput() );
00667 
00668 
00669 //      change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
00670    
00671 
00672         change->SetOutputSpacing ( spc[0] , spc[1] , spc[2] );
00673         change->Update();    //important
00674 
00675 //   change->SetExtentTranslation( ext[0], ext[2], ext[4] );
00676 //      change->Update();
00677 
00678 
00679         // write mdh file
00680    std::string nameMW            = filename+".mhd";
00681 
00682         vtkMetaImageWriter *writer = vtkMetaImageWriter::New( );
00683         writer->SetInput( change->GetOutput() );
00684         writer->SetFileName( nameMW.c_str() );
00685         writer->SetFileDimensionality( 3 );
00686         writer->Write( );
00687 
00688                 // write maracas file
00689         std::string nameM=filename+".maracas";
00690 
00691 
00692         FILE *ff;
00693         ff=fopen(nameM.c_str(),"w");
00694                 fprintf(ff,"MaracasType 200\n" );
00695                 fprintf(ff,"sizeX %d\n",dim[0] );
00696                 fprintf(ff,"sizeY %d\n",dim[1] );
00697                 fprintf(ff,"sizeZ1 %d\n",0 );
00698                 fprintf(ff,"sizeZ2 %d\n",dim[2] );
00699                 fprintf(ff,"spcX %f\n",spc[0]  );
00700                 fprintf(ff,"spcY %f\n",spc[1]  );
00701                 fprintf(ff,"spcZ %f\n",spc[2]  );
00702                 fprintf(ff,"intercept %f\n",intercept );
00703                 fprintf(ff,"slope %f\n",slope );
00704                 fprintf(ff,"LB %d\n",0 );
00705                 fprintf(ff,"bits %d\n",16 );
00706                 fprintf(ff,"%s.raw\n", name.c_str() );
00707         fclose(ff);
00708 
00709         writer  -> Delete();
00710         change  -> Delete();
00711         crop    -> Delete();
00712 }
00713 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1