Commit 91b2c8aa authored by Marc Modat's avatar Marc Modat

Added a -voff option for reg_resample and fixed the f3d and aladin one

parent c65e62c3
This diff is collapsed.
......@@ -311,7 +311,7 @@ int main(int argc, char **argv)
startProgress("reg_aladin");
// Output the command line
#ifndef NDEBUG
#ifdef NDEBUG
if(verbose)
{
#endif
......@@ -319,7 +319,7 @@ int main(int argc, char **argv)
for(int i=0; i<argc; i++)
printf(" %s", argv[i]);
printf("\n\n");
#ifndef NDEBUG
#ifdef NDEBUG
}
#endif
......@@ -508,7 +508,7 @@ int main(int argc, char **argv)
nifti_image_free(isoFloMaskImage);
delete REG;
#ifndef NDEBUG
#ifdef NDEBUG
if(verbose)
{
#endif
......@@ -518,7 +518,7 @@ int main(int argc, char **argv)
int seconds=(int)(end-start - 60*minutes);
printf("Registration Performed in %i min %i sec\n", minutes, seconds);
printf("Have a good day !\n");
#ifndef NDEBUG
#ifdef NDEBUG
}
#endif
......
......@@ -141,13 +141,13 @@ void Usage(char *exec)
printf("\t-noConj\t\t\tTo not use the conjuage gradient optimisation but a simple gradient ascent\n");
printf("\t-pert <int>\t\tTo add perturbation step(s) after each optimisation scheme\n");
printf("\n*** F3D_SYM options:\n");
printf("\t-sym \t\t\tUse symmetric approach\n");
printf("\t-fmask <filename>\tFilename of a mask image in the floating space\n");
printf("\t-ic <float>\t\tWeight of the inverse consistency penalty term [0.01]\n");
// printf("\n*** F3D_SYM options:\n");
// printf("\t-sym \t\t\tUse symmetric approach\n");
// printf("\t-ic <float>\t\tWeight of the inverse consistency penalty term [0.01]\n");
printf("\n*** F3D2 options:\n");
printf("\t-vel \t\t\tUse a velocity field integration to generate the deformation\n");
printf("\t-fmask <filename>\tFilename of a mask image in the floating space\n");
printf("\n*** Other options:\n");
printf("\t-smoothGrad <float>\tTo smooth the metric derivative (in mm) [0]\n");
......@@ -222,7 +222,7 @@ int main(int argc, char **argv)
}
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
// Output the command line
#ifndef NDEBUG
#ifdef NDEBUG
if(verbose)
{
#endif
......@@ -230,7 +230,7 @@ int main(int argc, char **argv)
for(int i=0; i<argc; i++)
printf(" %s", argv[i]);
printf("\n\n");
#ifndef NDEBUG
#ifdef NDEBUG
}
#endif
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
......@@ -857,13 +857,13 @@ int main(int argc, char **argv)
int minutes = (int)floorf(float(end-start)/60.0f);
int seconds = (int)(end-start - 60*minutes);
#ifndef NDEBUG
#ifdef NDEBUG
if(verbose)
{
#endif
printf("[NiftyReg F3D] Registration Performed in %i min %i sec\n", minutes, seconds);
printf("[NiftyReg F3D] Have a good day !\n");
#ifndef NDEBUG
#ifdef NDEBUG
}
#endif
return 0;
......
......@@ -87,7 +87,7 @@ int main(int argc, char **argv)
}
// else if(strcmp(argv[i], "--xml")==0)
// {
// printf("%s",xml_resample);
// printf("%s",xml_measure);
// return 0;
// }
#ifdef _SVN_REV
......
......@@ -74,8 +74,9 @@ void Usage(char *exec)
printf("\t-blank <filename> \tFilename of the resampled blank grid [none]\n");
printf("\t*\tOthers\n");
printf("\t-inter <int> \t\tInterpolation order (0,1,3)[3]\n");
printf("\t-inter <int> \t\tInterpolation order (0,1,3)[3] (0=NN, 1=LIN; 3=CUB)\n");
printf("\t-pad <int> \t\tInterpolation padding value [0]\n");
printf("\t-voff\t\t\tTurns verbose off [on]\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
return;
}
......@@ -87,6 +88,7 @@ int main(int argc, char **argv)
param->interpolation=3; // Cubic spline interpolation used by default
param->paddingValue=0;
bool verbose=true;
/* read the input parameter */
for(int i=1; i<argc; i++)
......@@ -103,6 +105,10 @@ int main(int argc, char **argv)
printf("%s",xml_resample);
return 0;
}
else if(strcmp(argv[i], "-voff")==0)
{
verbose=false;
}
#ifdef _SVN_REV
if( strcmp(argv[i], "-version")==0 ||
strcmp(argv[i], "-Version")==0 ||
......@@ -234,18 +240,20 @@ int main(int argc, char **argv)
/* *********************************** */
/* DISPLAY THE RESAMPLING PARAMETERS */
/* *********************************** */
printf("\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("Command line:\n");
for(int i=0; i<argc; i++) printf(" %s", argv[i]);
printf("\n\n");
printf("Parameters\n");
printf("Reference image name: %s\n",referenceImage->fname);
printf("\t%ix%ix%i voxels, %i volumes\n",referenceImage->nx,referenceImage->ny,referenceImage->nz,referenceImage->nt);
printf("\t%gx%gx%g mm\n",referenceImage->dx,referenceImage->dy,referenceImage->dz);
printf("Floating image name: %s\n",floatingImage->fname);
printf("\t%ix%ix%i voxels, %i volumes\n",floatingImage->nx,floatingImage->ny,floatingImage->nz,floatingImage->nt);
printf("\t%gx%gx%g mm\n",floatingImage->dx,floatingImage->dy,floatingImage->dz);
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
if(verbose){
printf("\n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("Command line:\n");
for(int i=0; i<argc; i++) printf(" %s", argv[i]);
printf("\n\n");
printf("Parameters\n");
printf("Reference image name: %s\n",referenceImage->fname);
printf("\t%ix%ix%i voxels, %i volumes\n",referenceImage->nx,referenceImage->ny,referenceImage->nz,referenceImage->nt);
printf("\t%gx%gx%g mm\n",referenceImage->dx,referenceImage->dy,referenceImage->dz);
printf("Floating image name: %s\n",floatingImage->fname);
printf("\t%ix%ix%i voxels, %i volumes\n",floatingImage->nx,floatingImage->ny,floatingImage->nz,floatingImage->nt);
printf("\t%gx%gx%g mm\n",floatingImage->dx,floatingImage->dy,floatingImage->dz);
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n");
}
/* *********************** */
/* READ THE TRANSFORMATION */
......@@ -440,7 +448,8 @@ int main(int argc, char **argv)
memset(warpedImage->descrip, 0, 80);
strcpy (warpedImage->descrip,"Warped image using NiftyReg (reg_resample)");
reg_io_WriteImageFile(warpedImage,param->outputResultName);
printf("[NiftyReg] Resampled image has been saved: %s\n", param->outputResultName);
if(verbose)
printf("[NiftyReg] Resampled image has been saved: %s\n", param->outputResultName);
nifti_image_free(warpedImage);
}
......@@ -519,7 +528,8 @@ int main(int argc, char **argv)
reg_io_WriteImageFile(warpedImage,param->outputResultName);
nifti_image_free(warpedImage);
nifti_image_free(gridImage);
printf("[NiftyReg] Resampled grid has been saved: %s\n", param->outputResultName);
if(verbose)
printf("[NiftyReg] Resampled grid has been saved: %s\n", param->outputResultName);
}
// Tell the CLI that we finished
......
......@@ -91,8 +91,8 @@ void Usage(char *exec)
printf("\t-comp <filename1> <filename2> <filename3>\n");
printf("\t\tCompose two transformations of any recognised type* and returns a deformation field.\n");
printf("\t\tTrans3(x) = Trans2(Trans1(x)).\n");
printf("\t\tfilename1 - Input transformation 1 file name\n");
printf("\t\tfilename2 - Input transformation 2 file name\n");
printf("\t\tfilename1 - Input transformation 1 file name (associated with -ref if required)\n");
printf("\t\tfilename2 - Input transformation 2 file name (associated with -ref2 if required)\n");
printf("\t\tfilename3 - Output deformation field file name\n\n");
printf("\t-updSform <filename1> <filename2> <filename3>\n");
......
......@@ -148,7 +148,7 @@ int reg_aladin<T>::Print()
/* *********************************** */
/* DISPLAY THE REGISTRATION PARAMETERS */
/* *********************************** */
#ifndef NDEBUG
#ifdef NDEBUG
if(this->Verbose)
{
#endif
......@@ -162,8 +162,7 @@ int reg_aladin<T>::Print()
printf("[%s] Maximum iteration number: %i", this->ExecutableName, this->MaxIterations);
printf(" (%i during the first level)\n", 2*this->MaxIterations);
printf("[%s] Percentage of blocks: %i %%", this->ExecutableName, this->BlockPercentage);
// printf(" (100%% during the first level)\n");
#ifndef NDEBUG
#ifdef NDEBUG
}
#endif
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment