]> Creatis software - clitk.git/commitdiff
solved bug 442 (2D+t vector field)
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Tue, 7 Jun 2011 14:41:18 +0000 (16:41 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Tue, 7 Jun 2011 14:41:18 +0000 (16:41 +0200)
- added another image type: VECTORFIELDWITHTIME

common/vvImageReader.h
common/vvImageReader.txx
vv/vvSlicerManager.cxx

index a646a01384cbfb9c675d71e89502bcea1e9516c1..2f1de53537794d937e16c4770ff8828eeddeddd5 100644 (file)
@@ -35,6 +35,7 @@ public:
   IMAGEWITHTIME,
   MERGEDWITHTIME,
   VECTORFIELD,
+  VECTORFIELDWITHTIME,
   UNDEFINEDIMAGETYPE
   } LoadedImageType;
 
index 3a38719c2d4a16eedaed620bccd77ebb3aa58510..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>();
@@ -162,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());
index 5a3b44fbf8b2f8ff70e5570c6a3f3933f1ea5aa0..987162cc6b420a0d3c8d25e557174c5b5e27945e 100644 (file)
@@ -305,7 +305,11 @@ bool vvSlicerManager::SetVF(std::string filename)
   if (mVectorReader.IsNull())
     mVectorReader = vvImageReader::New();
   mVectorReader->SetInputFilename(filename);
-  mVectorReader->Update(vvImageReader::VECTORFIELD);
+  
+  if (mType == vvImageReader::IMAGEWITHTIME)
+    mVectorReader->Update(vvImageReader::VECTORFIELDWITHTIME);
+  else
+    mVectorReader->Update(vvImageReader::VECTORFIELD);
   if (mVectorReader->GetLastError().size() != 0) {
     mLastError = mVectorReader->GetLastError();
     return false;