From ddeaf36cba7510b8b372add25f62d144b0848900 Mon Sep 17 00:00:00 2001 From: claude Date: Wed, 29 Oct 2014 12:00:00 -0400 Subject: [PATCH] Set verbose=0 for calls to Spawn that return parsed values --- ChangeLog | 3 +++ NEWS | 4 ++++ configure.in | 4 ++-- src/NUcorrect/nu_estimate_np_and_em.in | 16 ++++++++-------- src/NUcorrect/nu_evaluate.in | 8 ++++---- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index e143951..a77154b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Fixed some compiler warnings. * src/Splines/TBSpline.cc: Fixed memory overwrite. +2014-10-29 Claude Lepage + * Set verbose=0 for calls to Spawn that return parsed values + 2011-01-13 Claude Lepage * Fixed typo with headers in fieldIO.cc diff --git a/NEWS b/NEWS index 55aee2d..30a2929 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in Release 1.12.1 +--------------------- +* Set verbose=0 for calls to Spawn that return parsed values + New in Release 1.12.0 --------------------- * Moved Splines from EBTKS to N3 (must now use EBTKS 1.6.4 diff --git a/configure.in b/configure.in index 19bce7f..697ecd9 100644 --- a/configure.in +++ b/configure.in @@ -2,10 +2,10 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT dnl AC_CONFIG_AUX_DIR(ac_config_aux) -AM_INIT_AUTOMAKE(N3, 1.12.0) +AM_INIT_AUTOMAKE(N3, 1.12.1) AM_CONFIG_HEADER([include/config.h]) -AC_REVISION($Revision: 1.15 $) +AC_REVISION($Revision: 1.16 $) AC_PROG_INSTALL AC_PROG_LN_S diff --git a/src/NUcorrect/nu_estimate_np_and_em.in b/src/NUcorrect/nu_estimate_np_and_em.in index 0d33c25..4d9867f 100755 --- a/src/NUcorrect/nu_estimate_np_and_em.in +++ b/src/NUcorrect/nu_estimate_np_and_em.in @@ -13,9 +13,9 @@ # express or implied warranty. #---------------------------------------------------------------------------- #$RCSfile: nu_estimate_np_and_em.in,v $ -#$Revision: 1.7 $ +#$Revision: 1.8 $ #$Author: claude $ -#$Date: 2009-07-29 15:07:44 $ +#$Date: 2014-10-29 21:15:13 $ #$State: Exp $ #--------------------------------------------------------------------------- # ------------------------------ MNI Header ---------------------------------- @@ -30,7 +30,7 @@ #@CALLS : #@CREATED : January 15, 1996 J.G.Sled #@MODIFIED : -# $Id: nu_estimate_np_and_em.in,v 1.7 2009-07-29 15:07:44 claude Exp $ +# $Id: nu_estimate_np_and_em.in,v 1.8 2014-10-29 21:15:13 claude Exp $ #----------------------------------------------------------------------------- use warnings "all"; use MNI::Startup qw(nocputimes); @@ -305,7 +305,7 @@ sub CreateMask if($auto_mask_flag) { # determine if brain is in talairach space Spawn(['mincinfo', '-attvalue', 'xspace:spacetype', qw(-attvalue yspace:spacetype -attvalue zspace:spacetype), - $input_volume], err_action => 'ignore', stdout => \$output); + $input_volume], err_action => 'ignore', verbose => 0, stdout => \$output); @spacetype = split('\n', $output); (@spacetype == 3) && ($spacetype[0] =~ /talairach/i) && ($spacetype[1] =~ /talairach/i) && @@ -321,7 +321,7 @@ sub CreateMask if (defined($Mask)) { push(@VolumeStatsCmd, ('-mask', $Mask)); } - Spawn(\@VolumeStatsCmd, stdout => \$background_threshold); + Spawn(\@VolumeStatsCmd, verbose => 0, stdout => \$background_threshold); chop($background_threshold); } } @@ -376,7 +376,7 @@ sub CreateMask # Check that mask volume is not empty my $max; Spawn(['volume_stats', '-quiet', '-max', $mask_volume], - stdout => \$max); + verbose => 0, stdout => \$max); die("Error: Composite mask volume is empty. Check for one of the" ." following:\n 1) the user supplied mask is empty (all zeros)\n" ." 2) the values within the region of interest are entirely" @@ -599,7 +599,7 @@ sub normalize_field_volume (-r $_[1]) || die("&normalize_field_volume. Can't read file: $_[1]\n"); Spawn(['volume_stats', '-quiet', '-mean', '-mask', $mask, $volume], - stdout => \$mean); + verbose => 0, stdout => \$mean); if(chomp($mean) != 0) { Spawn("mincmath -div -const $mean $volume $norm_field_volume"); Spawn("mv $norm_field_volume $volume"); @@ -704,7 +704,7 @@ sub field_CV (-r $_[0]) || die("field_CV. Can't read file: $_[0]\n"); Spawn(['volume_stats', '-quiet', '-stddev', '-mean', - '-mask', $_[1], $_[0]], stdout => \$result); + '-mask', $_[1], $_[0]], verbose => 0, stdout => \$result); ($mean, $stddev) = split("\n",$result); ($stddev =~ /NAN/i) && die("function: field_CV()\n" ."Field standard deviation not defined\n"); diff --git a/src/NUcorrect/nu_evaluate.in b/src/NUcorrect/nu_evaluate.in index d7649a7..b1d43c7 100755 --- a/src/NUcorrect/nu_evaluate.in +++ b/src/NUcorrect/nu_evaluate.in @@ -13,9 +13,9 @@ # express or implied warranty. #---------------------------------------------------------------------------- #$RCSfile: nu_evaluate.in,v $ -#$Revision: 1.4 $ +#$Revision: 1.5 $ #$Author: claude $ -#$Date: 2010-12-09 19:35:01 $ +#$Date: 2014-10-29 21:15:13 $ #$State: Exp $ #--------------------------------------------------------------------------- # ------------------------------ MNI Header ---------------------------------- @@ -30,7 +30,7 @@ #@CALLS : #@CREATED : August 7, 1996 J.G.Sled #@MODIFIED : -# $Id: nu_evaluate.in,v 1.4 2010-12-09 19:35:01 claude Exp $ +# $Id: nu_evaluate.in,v 1.5 2014-10-29 21:15:13 claude Exp $ #----------------------------------------------------------------------------- use MNI::Startup qw(nocputimes); @@ -49,7 +49,7 @@ use Getopt::Tabular; if( !( defined $user_mask_volume ) || !( -e $user_mask_volume ) ) { my $threshold = 0; &Spawn(['mincstats', '-quiet', '-biModalT', $input_volume], - err_action => 'ignore', stdout => \$threshold ); + err_action => 'ignore', verbose => 0, stdout => \$threshold ); $user_mask_volume = "${TmpDir}/nuc_auto_mask.mnc"; &Spawn(['minccalc', '-quiet', '-byte', '-expression', "if(A[0]>=$threshold){out=1}else{out=0}",