Changeset 12207
- Timestamp:
- Mar 2, 2007, 4:37:29 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_imfile.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_imfile.pl
r12021 r12207 88 88 89 89 90 # Switches for regtool91 use constant REGTOOL_MODE => '-addprocessedimfile'; # Mode for regtool92 use constant REGTOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id93 use constant REGTOOL_CLASSID => '-class_id'; # Switch to specify the class id94 use constant REGTOOL_BG_MEAN => '-bg'; # Switch to add the background95 use constant REGTOOL_BG_STDEV => '-bg_stdev'; # Switch to add the bg stdev96 use constant REGTOOL_BG_MEAN_STDEV => '-bg_mean_stdev'; # Switch to add the bg mean stdev97 98 90 # Look for programs we need 99 91 my $missing_tools; … … 158 150 # Push the results into the database 159 151 unless ($no_update) { 160 my @command; 161 push @command, $regtool, REGTOOL_MODE(), REGTOOL_EXPTAG(), $exp_tag, REGTOOL_CLASSID(), $class_id; # Command to run regtool 152 my $command = "$regtool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id"; # Command to run regtool 162 153 163 154 foreach my $constant (keys %{CONSTANTS()}) { 164 push @command, CONSTANTS->{$constant}, ($stats->data($constant))->{value}; 165 166 } 155 my $value = ($stats->data($constant))->{value}; 156 if ($value =~ /\s/) { 157 # Quote arguments with whitespace 158 $value = "\'$value\'"; 159 } 160 $command .= ' ' . CONSTANTS->{$constant} . ' ' . $value; 161 } 162 167 163 foreach my $variable (keys %{VARIABLES()}) { 168 164 # Just use the mean value 169 push @command, VARIABLES->{$variable}, ($stats->data($variable))->{mean}; 170 } 171 172 push @command, REGTOOL_BG_MEAN(); 173 if (defined $stats->bg_mean()) { 174 push @command, $stats->bg_mean(); 175 } else { 176 push @command, "NAN"; 177 } 178 push @command, REGTOOL_BG_STDEV(); 179 if (defined($stats->bg_stdev())) { 180 push @command, $stats->bg_stdev(); 181 } else { 182 # Will not be defined if there is only a single imfile 183 push @command, 0; 184 } 185 push @command, REGTOOL_BG_MEAN_STDEV(); 186 if (defined $stats->bg_mean_stdev()) { 187 push @command, $stats->bg_mean_stdev(); 188 } else { 189 push @command, "0.0"; 190 } 191 192 # Quote arguments with whitespace 193 for (my $i = 0; $i < scalar @command; $i++) { 194 if ($command[$i] =~ /\s/) { 195 $command[$i] = "\'$command[$i]\'"; 196 } 197 } 198 199 push @command, "-dbname", $dbname if defined $dbname; 165 $command .= ' ' . VARIABLES->{$variable} . ' ' . ($stats->data($variable))->{mean}; 166 } 167 168 my $bg = ($stats->bg_mean() or 'NAN'); 169 my $bg_stdev = ($stats->bg_stdev() or 'NAN'); 170 my $bg_mean_stdev = ($stats->bg_mean_stdev() or 'NAN'); 171 $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; 172 173 $command .= "-dbname $dbname" if defined $dbname; 200 174 201 175 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 202 run(command => \@command, verbose => 1);176 run(command => $command, verbose => 1); 203 177 204 178 unless ($success) {
Note:
See TracChangeset
for help on using the changeset viewer.
