]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of /home/dsarrut/clitk3.server
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Wed, 6 Jul 2011 11:35:37 +0000 (13:35 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Wed, 6 Jul 2011 11:35:37 +0000 (13:35 +0200)
13 files changed:
CTestConfig.cmake
DartConfiguration.tcl [deleted file]
tests/CMakeLists.txt
tests/fetch_data_test.bat [new file with mode: 0644]
tests/fetch_data_test.sh [new file with mode: 0755]
tests/tools/CMakeLists.txt
tests/tools/clitkAffineTransformTest.cxx
tests/tools/clitkImageInfoTest.cxx
tests/tools/clitkImageInfoTest_oldWay.cpp [new file with mode: 0644]
tests/tools/clitkWriteDicomSeriesTest.cxx
tests/tools/toolTestRunner.cxx [new file with mode: 0644]
tests/vv/vvRegisterFormTest.cxx
tools/clitkAffineTransformGenericFilter.txx

index 81c2402c7bf69dd79e15511501fee62f03eddbab..502b5f03f65194b8f16b5aa3d105476355d7305e 100644 (file)
@@ -1,7 +1,16 @@
-set(CTEST_PROJECT_NAME "vv_itk4")
-set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
+MACRO(SET_IF_NOT_SET var val)
+  IF(NOT DEFINED "${var}")
+    SET("${var}" "${val}")
+  ENDIF(NOT DEFINED "${var}")
+ENDMACRO(SET_IF_NOT_SET)
+# Set them in a dart file when using ctest to submit on an other dashboard
+# Those are set for running a classical make Experimental
+SET_IF_NOT_SET(CTEST_DROP_METHOD "http")
+SET_IF_NOT_SET(CTEST_DROP_SITE "my.cdash.org")
+SET_IF_NOT_SET(CTEST_DROP_LOCATION "/submit.php?project=VV")
+SET_IF_NOT_SET(CTEST_DROP_SITE_CDASH TRUE)
+SET_IF_NOT_SET(CTEST_PROJECT_NAME "vv_itk4")
+SET_IF_NOT_SET(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.cdash.org")
-set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Insight")
-set(CTEST_DROP_SITE_CDASH TRUE)
+#=========================================================
+SET(CLITK_TEST_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data/ CACHE INTERNAL DOCSTRING)
\ No newline at end of file
diff --git a/DartConfiguration.tcl b/DartConfiguration.tcl
deleted file mode 100644 (file)
index 789d086..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-# This file is configured by CMake automatically as DartConfiguration.tcl
-# If you choose not to use CMake, this file may be hand configured, by
-# filling in the required variables.
-
-
-# Configuration directories and files
-SourceDirectory: /home/mpech/workspace/vvSource
-BuildDirectory: /home/mpech/workspace/vvSource
-
-# Where to place the cost data store
-CostDataFile: 
-
-# Site is something like machine.domain, i.e. pragmatic.crd
-Site: russule
-
-# Build name is osname-revision-compiler, i.e. Linux-2.4.2-2smp-c++
-BuildName: Linux-c++
-
-# Submission information
-IsCDash: TRUE
-CDashVersion: 
-QueryCDashVersion: 
-DropSite: localhost
-DropLocation: /cdash/submit.php?project=vv
-DropSiteUser: 
-DropSitePassword: 
-DropSiteMode: 
-DropMethod: http
-TriggerSite: 
-ScpCommand: /usr/bin/scp
-
-# Dashboard start time
-NightlyStartTime: 00:00:00 EST
-
-# Commands for the build/test/submit cycle
-ConfigureCommand: "/usr/bin/cmake" "/home/mpech/workspace/vvSource"
-MakeCommand: /usr/bin/gmake -i
-DefaultCTestConfigurationType: Release
-
-# CVS options
-# Default is "-d -P -A"
-CVSCommand: /usr/bin/cvs
-CVSUpdateOptions: -d -A -P
-
-# Subversion options
-SVNCommand: /usr/bin/svn
-SVNUpdateOptions: 
-
-# Git options
-GITCommand: /usr/bin/git
-GITUpdateOptions: 
-GITUpdateCustom: 
-
-# Generic update command
-UpdateCommand: /usr/bin/git
-UpdateOptions: 
-UpdateType: git
-
-# Compiler info
-Compiler: /usr/bin/c++
-
-# Dynamic analysis and coverage
-PurifyCommand: 
-ValgrindCommand: 
-ValgrindCommandOptions: 
-MemoryCheckCommand: MEMORYCHECK_COMMAND-NOTFOUND
-MemoryCheckCommandOptions: 
-MemoryCheckSuppressionFile: 
-CoverageCommand: /usr/bin/gcov
-
-# Cluster commands
-SlurmBatchCommand: SLURM_SBATCH_COMMAND-NOTFOUND
-SlurmRunCommand: SLURM_SRUN_COMMAND-NOTFOUND
-
-# Testing options
-# TimeOut is the amount of time in seconds to wait for processes
-# to complete during testing.  After TimeOut seconds, the
-# process will be summarily terminated.
-# Currently set to 25 minutes
-TimeOut: 1500
-
-UseLaunchers: 
-CurlOptions: 
-# warning, if you add new options here that have to do with submit,
-# you have to update cmCTestSubmitCommand.cxx
-
-# For CTest submissions that timeout, these options
-# specify behavior for retrying the submission
-CTestSubmitRetryDelay: 5
-CTestSubmitRetryCount: 3
index fcacae041d9ce5432b9f831754bdb18fe8a49951..0ad6b8575e4660e93ca988a4642aa433be4fe2c5 100644 (file)
@@ -1,8 +1,13 @@
 cmake_policy(SET CMP0005 NEW)
 #=========================================================
+
+#=========================================================
+# Data tests path
+ADD_DEFINITIONS(-DCLITK_TEST_DATA_PATH=\"${CLITK_TEST_DATA_PATH}/\")
+#=========================================================
+#=========================================================
 # Google test macro
 macro(ADD_GOOGLE_TESTS executable)
-message(exe : ${executable})
   foreach ( source ${ARGN} )
     file(READ "${source}" contents)
     string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
@@ -18,11 +23,6 @@ SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests/bin)
 SET(BUILDNAME ${CMAKE_SYSTEM_NAME}${CMAKE_OSX_ARCHITECTURES} CACHE INTERNAL DOCSTRING)
 #=========================================================
 #=========================================================
-# Data tests path
-FIND_PATH(CLITK_DATA_PATH data)
-ADD_DEFINITIONS(-DCLITK_DATA_PATH=\"${CLITK_DATA_PATH}\")
-#=========================================================
-#=========================================================
 # GoogleTest framemwork
 FIND_PATH(GTEST_DIR gtest)
 INCLUDE_DIRECTORIES(${GTEST_DIR}/include/)
diff --git a/tests/fetch_data_test.bat b/tests/fetch_data_test.bat
new file mode 100644 (file)
index 0000000..40272ab
--- /dev/null
@@ -0,0 +1,3 @@
+# take in arguments the folder to pull in
+# get repo's name
+# run git pull
diff --git a/tests/fetch_data_test.sh b/tests/fetch_data_test.sh
new file mode 100755 (executable)
index 0000000..f516146
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# arg[1] is TESTING_BINARY_DIR
+# This script has been edited from itk/Modules/ThirdParty/NIFTI/src/nifti/Testing/nifti_regress_test/cmake_testscripts/fetch_data_test.sh
+if cd $1
+then
+  git pull
+else
+  git clone $2 $1
+fi
+exit 0
+
index 8c6c282779e0a280d5f389fdce066cdc4dda2c28..b79dab4de686793797352b92162eebe56f45b8f4 100644 (file)
@@ -4,12 +4,33 @@ include_directories(
   ${GTEST_DIR}/include
 )
 
-FILE(GLOB srcs *.cxx)
-ADD_EXECUTABLE(toolsTest ${srcs})
-ADD_DEFINITIONS(-DTOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\")
-target_link_libraries(toolsTest vvLib ${vvExternalLibs} gtest)
+SET (CUSTOM_TEST_SRC
+  clitkImageInfoTest.cxx
+  vvMainTest.cxx
+)
+ADD_EXECUTABLE(toolsTest ${CUSTOM_TEST_SRC})
+ADD_DEFINITIONS(-DCLITK_TEST_TOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\")
+TARGET_LINK_LIBRARIES(toolsTest vvLib ${vvExternalLibs} gtest)
 
 # Add all tests found in the source code, calling the executable to run them
 add_google_tests ( ${EXECUTABLE_OUTPUT_PATH}/toolsTest ${srcs})
 
-SET(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING)
\ No newline at end of file
+SET(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING)
+
+SET (srcs
+  toolTestRunner.cxx
+)
+ADD_EXECUTABLE(toolTestRunner ${srcs})
+TARGET_LINK_LIBRARIES(toolTestRunner vvLib ${vvExternalLibs})
+SET(exe ${EXECUTABLE_OUTPUT_PATH}/toolTestRunner) 
+SET(p ${CLITK_TEST_DATA_PATH})
+#=========================================================
+# clitkImageInfo
+ADD_TEST(clitkImageInfo_1 ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info)
+ADD_TEST(clitkImageInfo_2 ${exe} clitkImageInfo ${p}Lung3D.mhd ${p}Lung3D_ref.info)
+#=========================================================
+# clitkGetSpacing
+ADD_TEST(clitkGetSpacing_1 ${exe} clitkGetSpacing ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing)
+ADD_TEST(clitkGetSpacing_2 ${exe} clitkGetSpacing ${p}Lung3D.mhd ${p}Deformation4D_ref.spacing)
+UNSET(exe)
+UNSET(p)
\ No newline at end of file
index 1af7cc2dc7fcb8d6567cd4a14923d07eb1cf7dbb..2a7fe92e8089977a61fbb9bae44a8d35d4fe6156 100644 (file)
 #include <itksys/SystemTools.hxx>
 static inline void compare(std::string mhd, std::string refMhd, std::string refRaw){
   std::ostringstream cmd_line;
+  
+  //Ensure the description file exists
   ASSERT_TRUE(itksys::SystemTools::FileExists(mhd.c_str(), true));
+  
+  //Ensure the description reference file exists
   ASSERT_TRUE(itksys::SystemTools::FileExists(refMhd.c_str(), true));
+  
+  //Ensure our reference raw exists
   ASSERT_TRUE(itksys::SystemTools::FileExists(refRaw.c_str(), true));
+//todo : test this on windows  
+  //Generate the new mhd and the new raw
   cmd_line << TOOLS_PATH<<"clitkAffineTransform -i " << mhd << " -o "<<"out.mhd >/dev/null";
   system(cmd_line.str().c_str());
+  
+  //Check the new file has been created
   EXPECT_TRUE(itksys::SystemTools::FileExists("out.mhd", true));
+  
+  //Check the mhd and the produced mhd are still equal
   EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.mhd", refMhd.c_str())  );
-  EXPECT_FALSE( itksys::SystemTools::FilesDiffer("out.raw", refRaw.c_str())  );
+  
+  //Check the raw and the produced raw are different
+  EXPECT_TRUE( itksys::SystemTools::FilesDiffer("out.raw", refRaw.c_str())  );
+  
+  //clean the produced junk
   remove("out.mhd");
   remove("out.raw");
 }
-TEST(clitkAffineTransformTest, main){
-  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
-  std::string refMhd1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.mhd";
-  std::string refRaw1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.raw";
+TEST(identity, clitkAffineTransformTest){
+  std::string mhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4D.mhd";
+  std::string refMhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4DRef.mhd";
+  std::string refRaw1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4DRef.raw";
   compare(mhd1, refMhd1, refRaw1);
 }
\ No newline at end of file
index 4f8413c798fba30ae8878e9a216cc22eded500b8..0b3f30394a178b6cb08c7dffdfbeacc17091f312 100644 (file)
@@ -31,14 +31,14 @@ static inline void compare(std::string mhd, std::string ref){
   remove("clitkImageInfoTest.out");
 }
 TEST(clitkImageInfoTest, main){
-  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
+  std::string mhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4D.mhd";
   ASSERT_TRUE(itksys::SystemTools::FileExists(mhd1.c_str(), true));
   
-  std::string mhd2=std::string(CLITK_DATA_PATH)+"Lung3D.mhd";
+  std::string mhd2=std::string(CLITK_TEST_DATA_PATH)+"Lung3D.mhd";
   ASSERT_TRUE(itksys::SystemTools::FileExists(mhd2.c_str(), true));
   
   mhd1+=" "+mhd2;
-  std::string ref1=std::string(CLITK_DATA_PATH)+"clitkImageInfoTestRef.out";
+  std::string ref1=std::string(CLITK_TEST_DATA_PATH)+"clitkImageInfoTestRef.out";
   ASSERT_TRUE(itksys::SystemTools::FileExists(ref1.c_str(), true));
   compare(mhd1, ref1);
 }
\ No newline at end of file
diff --git a/tests/tools/clitkImageInfoTest_oldWay.cpp b/tests/tools/clitkImageInfoTest_oldWay.cpp
new file mode 100644 (file)
index 0000000..634a68c
--- /dev/null
@@ -0,0 +1,63 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
+
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
+
+  It is distributed under dual licence
+
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================*/
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <fstream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <itksys/SystemTools.hxx>
+int main(int argc, char** argv){
+  int fail = 1;
+  std::string mhd = std::string(CLITK_TEST_DATA_PATH);
+  std::string ref = std::string(CLITK_TEST_DATA_PATH);
+  
+  //We select which image we use to test clitkImageInfo
+  int idImg = atoi(argv[1]);
+  switch(idImg){
+     case '0':
+       mhd += "Deformation4D.mhd";
+       ref += "clitkImageInfoTestRef";
+      break;
+     case '1':
+       mhd += "Lung3D.mhd";
+       ref += "clitkImageInfoTestRef";
+      break;
+    default:
+      return fail;
+  }  
+  //end of selection
+  
+  //ensure mhd do exist
+  if(!itksys::SystemTools::FileExists(mhd.c_str(), true)){
+      return fail;
+  }
+  //ensure ref do exist
+  if(!itksys::SystemTools::FileExists(ref.c_str(), true)){
+      return fail;
+  }
+  
+  std::ostringstream cmd_line;
+  cmd_line << TOOLS_PATH <<"clitkImageInfo " << mhd << " > clitkImageInfoTest.out";
+  system(cmd_line.str().c_str());
+  
+  //files should be equal, so if this is the case return success=0
+  fail = (itksys::SystemTools::FilesDiffer("clitkImageInfoTest.out", ref.c_str()))?0:1;
+  remove("clitkImageInfoTest.out");
+  return fail;
+}
index bc63080a459b6c104046b75ae4aba47dab66c8d5..2e0c505c4bbfb00949d1e09b682bb12e842cd5d1 100644 (file)
@@ -21,8 +21,8 @@
 #include <itksys/SystemTools.hxx>
 TEST(clitkWriteDicomSeriesTest, main){
   
-  std::string fIn=std::string(CLITK_DATA_PATH)+"/3d/mhd/00.mhd";
-  std::string fOut=std::string(CLITK_DATA_PATH)+"/3d/dcm/1.2.840.113704.1.111.536.1248695032.26";
+  std::string fIn=std::string(CLITK_TEST_DATA_PATH)+"/3d/mhd/00.mhd";
+  std::string fOut=std::string(CLITK_TEST_DATA_PATH)+"/3d/dcm/1.2.840.113704.1.111.536.1248695032.26";
   ASSERT_TRUE(itksys::SystemTools::FileExists(fIn.c_str(), true));
   std::ostringstream cmd_line;
   cmd_line << TOOLS_PATH <<"clitkWriteDicomSeries -i " << fIn << " -d " << fOut << " -o dcm --verbose";
diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx
new file mode 100644 (file)
index 0000000..0eb1f90
--- /dev/null
@@ -0,0 +1,89 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
+
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
+
+  It is distributed under dual licence
+
+  - BSD        See included LICENSE.txt file
+  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================*/
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <fstream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <itksys/SystemTools.hxx>
+const int NO_OUTPUT_OPTION=-1;
+int getOutputOptionIndex(int argc, char** argv){
+  for(int i=1; i<argc; i++){
+      std::string s = argv[i];
+      if(s=="-o"){
+        return i+1;
+      }
+  }
+  return NO_OUTPUT_OPTION;
+}
+inline char* getTmpFileName(){
+  char buffer [L_tmpnam];
+  char* back = tmpnam (buffer);
+  if(back==NULL){
+    exit(1);
+  }
+  return back;
+}
+/**
+ * argv
+ * [1] executable
+ * [2] random options
+ * [2.x] -o
+ * [2.x+1] outFileName
+ * [3] reference file
+ * 
+ * [2.x] and [2.x+1] are optional
+ */
+int main(int argc, char** argv){
+  //reference file must exist or we fail
+  char* refFile = argv[argc-1];
+  if(!(itksys::SystemTools::FileExists(refFile, true))){
+    std::cout<<"refFile "<<refFile<<" doesn't exist"<<std::endl; 
+    return 1;
+  } 
+  
+  std::ostringstream cmd_line;
+  cmd_line<<CLITK_TEST_TOOLS_PATH;
+  for(int i=1; i<argc-1; i++){
+  //we should ensure the file exists, find an -i index or a long file name maybe?
+      cmd_line<<argv[i]<<" ";
+  }
+
+  //look for the need of generating an output file
+  int outputOptionIndex = getOutputOptionIndex(argc, argv);
+  char* outFile;
+  if(NO_OUTPUT_OPTION==outputOptionIndex){
+    outFile = getTmpFileName();
+    cmd_line<<" > "<<outFile;
+  }else{
+    //todo test this else branch
+    std::string s = std::string(CLITK_TEST_DATA_PATH);
+    s+=argv[outputOptionIndex];
+    //DO NOT MODIFY outFile
+    outFile = (char*)s.c_str();
+  }
+  
+  //run the command line
+  system(cmd_line.str().c_str());
+  
+  //files should be equal, so if this is the case return success=0
+  int fail = (itksys::SystemTools::FilesDiffer(outFile, refFile))?1:0;
+  remove(outFile);
+  return fail;
+}
index 15d88c4fb41dd6d2cb1b488487705934ccd7f4b8..6c623dfc3f4d04e024694d751f93ccdf2ed4ba5f 100644 (file)
@@ -22,7 +22,7 @@
 #include "vvConfiguration.h"
 #include <stdio.h>
 #include <fstream>
-const std::string data_path = CLITK_DATA_PATH;
+const std::string data_path = CLITK_TEST_DATA_PATH;
 TEST(vvRegisterForm, canPush){
   QUrl url;
   //the file exists with some old lines
index c758cb2f80273b6c7576abfe04626f0adee996ff..ef81fe2d464bc7082ed42a8f2d9ae1d5856ea3dc 100644 (file)
@@ -168,7 +168,20 @@ AffineTransformGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
     typename itk::Matrix<double, Dimension, Dimension> invRotMatrix( clitk::GetRotationalPartMatrix(invMatrix) );
     typename itk::Vector<double,Dimension> invTrans =  clitk::GetTranslationPartMatrix(invMatrix);
 
-    // Size is converted to double, transformed and converted back to size type
+    // Spacing is influenced by affine transform matrix and input direction
+    typename InputImageType::SpacingType outputSpacing;
+    outputSpacing = invRotMatrix *
+                    input->GetDirection() *
+                    input->GetSpacing();
+
+    // Origin is influenced by translation but not by input direction
+    typename InputImageType::PointType outputOrigin;
+    outputOrigin = invRotMatrix *
+                   input->GetOrigin() +
+                   invTrans;
+
+    // Size is influenced by affine transform matrix and input direction
+    // Size is converted to double, transformed and converted back to size type.
     vnl_vector<double> vnlOutputSize(Dimension);
     for(unsigned int i=0; i< Dimension; i++) {
       vnlOutputSize[i] = input->GetLargestPossibleRegion().GetSize()[i];
@@ -178,18 +191,18 @@ AffineTransformGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
                     vnlOutputSize;
     typename OutputImageType::SizeType outputSize;
     for(unsigned int i=0; i< Dimension; i++) {
+      // If the size is negative, we have a flip and we must modify
+      // the origin and the spacing accordingly.
+      if(vnlOutputSize[i]<0.) {
+        vnlOutputSize[i] *= -1.;
+        outputOrigin[i] = outputOrigin[i] + outputSpacing[i] * (vnlOutputSize[i]-1);
+        outputSpacing[i] *= -1.;
+      }
       outputSize[i] = lrint(vnlOutputSize[i]);
     }
     resampler->SetSize( outputSize );
-    
-    // Spacing can be dictly computed in the same way
-    resampler->SetOutputSpacing ( invRotMatrix *
-                                  input->GetDirection() *
-                                  input->GetSpacing() );
-    // Origin is influenced by translation but not by direction
-    resampler->SetOutputOrigin ( invRotMatrix *
-                                 input->GetOrigin() +
-                                 invTrans );
+    resampler->SetOutputSpacing( outputSpacing );
+    resampler->SetOutputOrigin( outputOrigin );
   } else {
     //Size
     typename OutputImageType::SizeType outputSize;