From: Romulo Pinho Date: Tue, 7 Jun 2011 14:41:18 +0000 (+0200) Subject: solved bug 442 (2D+t vector field) X-Git-Tag: v1.3.0~326 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=21f45ad79a13d6320a591e4968b181ef48e2f96b;p=clitk.git solved bug 442 (2D+t vector field) - added another image type: VECTORFIELDWITHTIME --- diff --git a/common/vvImageReader.h b/common/vvImageReader.h index a646a01..2f1de53 100644 --- a/common/vvImageReader.h +++ b/common/vvImageReader.h @@ -35,6 +35,7 @@ public: IMAGEWITHTIME, MERGEDWITHTIME, VECTORFIELD, + VECTORFIELDWITHTIME, UNDEFINEDIMAGETYPE } LoadedImageType; diff --git a/common/vvImageReader.txx b/common/vvImageReader.txx index 3a38719..2d7d5b5 100644 --- a/common/vvImageReader.txx +++ b/common/vvImageReader.txx @@ -34,7 +34,7 @@ template void vvImageReader::UpdateWithDim(std::string InputPixelType) { - if (mType == VECTORFIELD) + if (mType == VECTORFIELD || mType == VECTORFIELDWITHTIME) UpdateWithDimAndInputPixelType,VImageDimension>(); else if (InputPixelType == "short") UpdateWithDimAndInputPixelType(); @@ -162,7 +162,7 @@ void vvImageReader::UpdateWithDimAndInputPixelType() reader->ReleaseDataFlagOn(); try { - if (mType == IMAGEWITHTIME) + if (mType == IMAGEWITHTIME || mType == VECTORFIELDWITHTIME) mImage=vvImageFromITK(reader->GetOutput(),true); else mImage=vvImageFromITK(reader->GetOutput()); diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index 5a3b44f..987162c 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -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;