Index: trunk/ippScripts/scripts/detrend_calc_norm.pl
===================================================================
--- trunk/ippScripts/scripts/detrend_calc_norm.pl	(revision 8764)
+++ trunk/ippScripts/scripts/detrend_calc_norm.pl	(revision 8850)
@@ -31,5 +31,5 @@
 my $files;			# The input files
 {
-    my $command = "$dettool -processed -unmask -det_id $detId -iter $iter"; # Command to run
+    my $command = "$dettool -processed -unmask -det_id $detId -iteration $iter"; # Command to run
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
 	run(command => $command, verbose => 1);
@@ -45,7 +45,7 @@
 my %matrix; # Matrix of statistics as a function of exposures and classes
 foreach my $file (@$files) {
-    my $expId = $file->{exp_id}; # Exposure ID
-    my $classId = $file->{class_id}; # Class ID
-    my $stat = $file->{STATISTIC}; # Statistic of interest
+    my $expId = $file->{'exp_id'}; # Exposure ID
+    my $classId = $file->{'class_id'}; # Class ID
+    my $stat = $file->{STATISTIC()}; # Statistic of interest
 
     # Create matrix elements
@@ -60,10 +60,9 @@
     print $normFile "$expId\tMETADATA\n";
     foreach my $classId (keys %{$matrix{$expId}}) {
-	print $normFile "\t$classId\tF32\t" . $matrix{$expId}->{$classId} . "\n";
+	print $normFile "\t" . $classId . "\tF32\t" . $matrix{$expId}->{$classId} . "\n";
     }
-    print $normFile "\n";
+    print $normFile "END\n\n";
 }
 close $normFile;
-
 
 # Run ppNormCalc
@@ -85,5 +84,5 @@
 	my $normalisation = $normItem->{value}; # Normalisation for component
 
-	my $command = "$dettool -addnormstat -det_id $detId -iter $iter -class_id $className ".
+	my $command = "$dettool -addnormstat -det_id $detId -iteration $iter -class_id $className ".
 	    "-norm $normalisation"; # Command to run
 	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
