From 70108bb69716af87ec136cab1172372bb244804a Mon Sep 17 00:00:00 2001 From: Renzo Date: Wed, 16 Oct 2019 18:43:03 +0200 Subject: [PATCH] Included extra anonymous stuff --- LN_DIRECT_SMOOTH.cpp | 72 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 9 deletions(-) diff --git a/LN_DIRECT_SMOOTH.cpp b/LN_DIRECT_SMOOTH.cpp index e39dcda..1685d21 100644 --- a/LN_DIRECT_SMOOTH.cpp +++ b/LN_DIRECT_SMOOTH.cpp @@ -37,7 +37,7 @@ int show_help( void ) " -laurenzian : use Laurenzian smoothing, default is Gaussian only for division images\n" " LN_DIRECT_SMOOTH -input bico_VASO.Mean.nii -FWHM 0.5 -direction 3 -laurenzian \n:" " -direction : argument to specify direction 1 for x, 2 for y or 3 for z \n" - + " -Anonymous_sri : You know what you did (no FWHM)/n" "\n"); return 0; @@ -47,8 +47,8 @@ int main(int argc, char * argv[]) { char * fout=NULL, * finfi=NULL ; - int ac, direction_i=0, do_laurenz = 0 ; - float FWHM_val=0 ; + int ac, direction_i=0, do_laurenz = 0 , do_gauss = 0, do_sri = 0 ; + float FWHM_val=10 , strength = 1; if( argc < 3 ) return show_help(); // typing '-help' is sooo much work // process user options: 4 are valid presently @@ -81,6 +81,15 @@ int main(int argc, char * argv[]) do_laurenz = 1; fprintf(stderr, "I will not use Gaussian smoothing but Laurenzian smoothing"); } + else if( ! strcmp(argv[ac], "-Anonymous_sri") ) { + if( ++ac >= argc ) { + fprintf(stderr, "** missing argument for -Anonymous_sri\n"); + //return 1; + } + do_sri = 1; + strength = atof(argv[ac]); // no string copy, just pointer assignment + fprintf(stderr, "Yes Sri I am doing you "); + } else { fprintf(stderr,"** invalid option, '%s'\n", argv[ac]); return 1; @@ -216,6 +225,8 @@ if (nim_inputfi->datatype == DT_FLOAT64 || nim_inputfi->datatype == NIFTI_TYPE_F float dist (float x1, float y1, float z1, float x2, float y2, float z2,float dX, float dY, float dZ) ; float gaus (float distance, float sigma) ; float laur (float distance, float sigma) ; +float ASLFt (float distance, float strength) ; + cout << "debug 2 " << endl; @@ -228,6 +239,16 @@ cout << " vinc " << vinc<< endl; cout << " FWHM_val " << FWHM_val<< endl; +if (do_sri == 0 && do_laurenz == 0 ) do_gauss = 1 ; + +if (do_sri == 1 ) { + + cout << " no FWHM_val is used Strength is " << strength<< endl; +} +//cout << " no FWHM_val is used Strength is " << strength<< endl; + + + /////////////////////////////////// ////SMOOTHING LOOP ///// /////////////////////////////////// @@ -238,6 +259,8 @@ cout << " FWHM_val " << FWHM_val<< endl; cout << " timestep ... " << flush ; + for (int i = 0 ; i<5 ; i++ ) cout << ASLFt(i ,strength ) << " " << endl ; + if (direction_i == 1 ) { for(int it=0; it= 4.0 ) value = 0.0 ; + if (distance <= 4.0 ) value = 0.0245 ; + if (distance <= 3.0 ) value = 0.024 ; + if (distance <= 2.0 ) value = 0.06 ; + if (distance <= 1.0 ) value = 0.18 ; + if (distance == 0.0 ) value = 1.0 ; + + + + + return value * strength; + } + +