]> Creatis software - clitk.git/blobdiff - common/vvImageReader.txx
Second version of RelativePositionAnalyzer
[clitk.git] / common / vvImageReader.txx
index 01fc707ed910373e5b96af38544083e0f7d4b03b..2d7d5b573f3c9a2985bfef023c21f4a542c53537 100644 (file)
@@ -34,7 +34,7 @@
 template<unsigned int VImageDimension>
 void vvImageReader::UpdateWithDim(std::string InputPixelType)
 {
-  if (mType == VECTORFIELD)
+  if (mType == VECTORFIELD || mType == VECTORFIELDWITHTIME)
     UpdateWithDimAndInputPixelType<itk::Vector<float,3>,VImageDimension>();
   else if (InputPixelType == "short")
     UpdateWithDimAndInputPixelType<short,VImageDimension>();
@@ -139,7 +139,12 @@ void vvImageReader::UpdateWithDimAndInputPixelType()
 
       try {
         if (mType == IMAGEWITHTIME)
-          mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput(),true);
+        {
+          std::cerr << "We should never come here:" << std::endl
+            << "  Calling vvImageReader with multiple images and IMAGEWITHTIME is undefined." << std::endl
+            << "  You are probably looking for MERGEDWITHTIME Type." << std::endl;
+          return;
+        }
         else
           mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput());
       } catch ( itk::ExceptionObject & err ) {
@@ -157,7 +162,7 @@ void vvImageReader::UpdateWithDimAndInputPixelType()
       reader->ReleaseDataFlagOn();
 
       try {
-        if (mType == IMAGEWITHTIME)
+        if (mType == IMAGEWITHTIME || mType == VECTORFIELDWITHTIME)
           mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput(),true);
         else
           mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput());