X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicerManager.cxx;h=fd8f09fccc30b4667a6e271076ca5000f2839512;hb=5f4539e40d4dd29c2a4768247feb384ffaa2bd02;hp=871c818a64acf3083e4706a5519ce56ae5d6eb33;hpb=8e55faf6d71d39430ea3c9e93a54d2f0399371d9;p=clitk.git diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index 871c818..fd8f09f 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; @@ -732,6 +736,27 @@ double vvSlicerManager::GetColorLevel() } //---------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType) +{ + if(actorType == "image") + this->GetImage()->GetTransform()->Identity(); + else if(actorType == "overlay") + this->GetSlicer(0)->GetOverlay()->GetTransform()->Identity(); + else if(actorType == "fusion") + this->GetSlicer(0)->GetFusion()->GetTransform()->Identity(); + else if(actorType == "vf") + this->GetVF()->GetTransform()->Identity(); + else + return; + + for(int i=0; i< this->GetNumberOfSlicers(); i++){ + this->GetSlicer(i)->ForceUpdateDisplayExtent(); + this->GetSlicer(i)->ResetCamera(); + this->GetSlicer(i)->Render(); + } +} +//------------------------------------------------------------------------------ //---------------------------------------------------------------------------- void vvSlicerManager::Render() @@ -1076,6 +1101,13 @@ void vvSlicerManager::SetColorMap(int colormap) LUT->SetHueRange(0.4,0.80); break; case 3: + if (LUT == NULL) + LUT = vtkLookupTable::New(); + LUT->SetValueRange(0.5,1); + LUT->SetSaturationRange(1,1); + LUT->SetHueRange(0.666,0); + break; + case 4: if (LUT == NULL) LUT = vtkLookupTable::New(); LUT->SetValueRange(0,1); @@ -1096,7 +1128,7 @@ void vvSlicerManager::SetColorMap(int colormap) LUT->Build(); } vtkWindowLevelLookupTable* fusLUT = NULL; - if (mSlicers[0]->GetFusion()) { // && mFusionColorMap != 0) { + if (mSlicers[0]->GetFusion()) { // && mFusionColorMap >= 0) { fusLUT = vtkWindowLevelLookupTable::New(); double fusRange [2]; fusRange[0] = mFusionLevel - mFusionWindow/2; @@ -1119,7 +1151,7 @@ void vvSlicerManager::SetColorMap(int colormap) } else if (mFusionColorMap == 4) fusLUT->SetHueRange(0,1); - else if (mFusionColorMap == 0) + else if (mFusionColorMap <= 0) { fusLUT->SetValueRange(0,1); fusLUT->SetSaturationRange(0,0); @@ -1127,7 +1159,7 @@ void vvSlicerManager::SetColorMap(int colormap) fusLUT->ForceBuild(); - // set color table transparancy + // set color table transparency double alpha_range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100; for (double i = frange[0]; i < alpha_range_end; i++) { double v[4]; @@ -1167,8 +1199,8 @@ void vvSlicerManager::SetColorMap(int colormap) } if (mSlicers[i]->GetFusion()) { - mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100); mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT); + mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100); } } if (fusLUT)