X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImageReader.txx;h=2d7d5b573f3c9a2985bfef023c21f4a542c53537;hb=578e4e5a84a390592ba6b2a7e8bff22dba19ccd0;hp=aac9979fc330d265d9f14e7d7b346860cd6ffa5f;hpb=dfa11bf97085931c9e1261fddc835528c8d86377;p=clitk.git diff --git a/common/vvImageReader.txx b/common/vvImageReader.txx index aac9979..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(); @@ -118,6 +118,9 @@ void vvImageReader::UpdateWithDimAndInputPixelType() filter->SetExtractionRegion(extractedRegion); filter->SetInput(reader->GetOutput()); filter->ReleaseDataFlagOn(); +#if ITK_VERSION_MAJOR == 4 + filter->SetDirectionCollapseToSubmatrix(); +#endif try { mImage->AddItkImage(filter->GetOutput()); } catch ( itk::ExceptionObject & err ) { @@ -136,7 +139,12 @@ void vvImageReader::UpdateWithDimAndInputPixelType() try { if (mType == IMAGEWITHTIME) - mImage=vvImageFromITK(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(reader->GetOutput()); } catch ( itk::ExceptionObject & err ) { @@ -154,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());