From: Eduardo DAVILA Date: Wed, 5 Jan 2022 10:07:41 +0000 (+0100) Subject: Clean code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=cfad6c728cd3ca29bc3f7be73e856a4f1295e9a1;p=bbtk.git Clean code --- diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index 4b000f0..8e233d6 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -748,9 +748,9 @@ namespace bbtk ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) ) { -//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() ); +// printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() ); this->bbProcess(); -//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() ); +// printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() ); } // Manual analysis //EED ups if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false)) diff --git a/packages/vtk/src/bbvtkMetaImageWriter.cxx b/packages/vtk/src/bbvtkMetaImageWriter.cxx index f17001e..17bef15 100644 --- a/packages/vtk/src/bbvtkMetaImageWriter.cxx +++ b/packages/vtk/src/bbvtkMetaImageWriter.cxx @@ -30,12 +30,12 @@ void MetaImageWriter::Save_mhdb( std::string filename , vtkImageData* img ,int int elementType=img->GetScalarType(); img->GetExtent(ext); - dim[0]=ext[1]-ext[0]+1; - dim[1]=ext[3]-ext[2]+1; - dim[2]=ext[5]-ext[4]+1; - int bsx=ceil((double)dim[0]/(double)sizeB); - int bsy=ceil((double)dim[1]/(double)sizeB); - int bsz=ceil((double)dim[2]/(double)sizeB); + dim[0] = ext[1]-ext[0]+1; + dim[1] = ext[3]-ext[2]+1; + dim[2] = ext[5]-ext[4]+1; + int bsx = ceil((double)dim[0]/(double)sizeB); + int bsy = ceil((double)dim[1]/(double)sizeB); + int bsz = ceil((double)dim[2]/(double)sizeB); int voi[6]; std::string filenameBlock; std::string filenameBlockVti; @@ -61,12 +61,12 @@ void MetaImageWriter::Save_mhdb( std::string filename , vtkImageData* img ,int { for (k=0;k=dim[0]) { voi[1]=dim[0]-1; } if (voi[3]>=dim[1]) { voi[3]=dim[1]-1; } if (voi[5]>=dim[2]) { voi[5]=dim[2]-1; } @@ -95,7 +95,7 @@ void MetaImageWriter::Save_mhdb( std::string filename , vtkImageData* img ,int writer->SetInputData( bbGetInputIn() ); writer->Write(); */ - + extract->Delete(); } // for k } // for j @@ -109,9 +109,6 @@ void MetaImageWriter::Save_mhdb( std::string filename , vtkImageData* img ,int //===== void MetaImageWriter::Process() { - -printf("EED vtkMetaImageWriter::Process START\n"); - // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -156,8 +153,8 @@ printf("EED vtkMetaImageWriter::Process START\n"); w->Delete(); } // .mhdb } // bbGetInputIn()!=NULL -printf("EED vtkMetaImageWriter::Process END\n"); } + //===== // 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) //===== @@ -169,32 +166,29 @@ void MetaImageWriter::bbUserSetDefaultValues() bbSetInputCompression(false); bbSetInputSizeBlock(20); } + //===== // 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) //===== void MetaImageWriter::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// if any } + //===== // 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) //===== void MetaImageWriter::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - -} } -// EO namespace bbvtk + +} // EO namespace bbvtk