X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=e4a6c55588ff316817db7d4af74713c27805a730;hb=ce4f422636ff94e4462cbd0f13f3c5dac66ce545;hp=42107987512a3c78686455c9e0f266ebb253b4e3;hpb=857c9e74552dccd4c71364c15cca4ade140511fc;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 4210798..e4a6c55 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -48,6 +48,7 @@ It is distributed under dual licence #include "vvSaveState.h" #include "vvReadState.h" #include "clitkConfiguration.h" +#include "clitkMatrix.h" // ITK include #include @@ -1145,7 +1146,7 @@ void vvMainWindow::ImageInfoChanged() infoPanel->setNPixel(QString::number(NPixel)+" ("+inputSizeInBytes+")"); transformation = imageSelected->GetTransform()[tSlice]->GetMatrix(); - infoPanel->setTransformation(Get4x4MatrixDoubleAsString(transformation)); + infoPanel->setTransformation(clitk::Get4x4MatrixDoubleAsString(transformation).c_str()); landmarksPanel->SetCurrentLandmarks(mSlicerManagers[index]->GetLandmarks(), mSlicerManagers[index]->GetTSlice()); @@ -1343,38 +1344,6 @@ QString vvMainWindow::GetSizeInBytes(unsigned long size) } //------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -QString vvMainWindow::Get4x4MatrixDoubleAsString(vtkSmartPointer matrix, const int precision) -{ - std::ostringstream strmatrix; - - // Figure out the number of digits of the integer part of the largest absolute value - // for each column - unsigned width[4]; - for (unsigned int j = 0; j < 4; j++){ - double absmax = 0.; - for (unsigned int i = 0; i < 4; i++) - absmax = std::max(absmax, vnl_math_abs(matrix->GetElement(i, j))); - unsigned ndigits = (unsigned)std::max(0.,std::log10(absmax))+1; - width[j] = precision+ndigits+3; - } - - // Output with correct width, aligned to the right - for (unsigned int i = 0; i < 4; i++) { - for (unsigned int j = 0; j < 4; j++) { - strmatrix.setf(ios::fixed,ios::floatfield); - strmatrix.precision(precision); - strmatrix.fill(' '); - strmatrix.width(width[j]); - strmatrix << std::right << matrix->GetElement(i, j); - } - strmatrix << std::endl; - } - QString result = strmatrix.str().c_str(); - return result; -} -//------------------------------------------------------------------------------ - //------------------------------------------------------------------------------ QString vvMainWindow::GetVectorDoubleAsString(std::vector vectorDouble) { @@ -1888,12 +1857,22 @@ void vvMainWindow::ApplyWindowLevelToAllImages() double window = mSlicerManagers[index]->GetColorWindow(); double level = mSlicerManagers[index]->GetColorLevel(); + double fusWindow = mSlicerManagers[index]->GetFusionWindow(); + double fusLevel = mSlicerManagers[index]->GetFusionLevel(); + + double overWindow = mSlicerManagers[index]->GetOverlayColorWindow(); + double overLevel = mSlicerManagers[index]->GetOverlayColorLevel(); + for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (mSlicerManagers[i] == NULL) continue; mSlicerManagers[i]->SetColorWindow(window); mSlicerManagers[i]->SetColorLevel(level); mSlicerManagers[i]->SetPreset(WL_USER); + mSlicerManagers[i]->SetFusionWindow(fusWindow); + mSlicerManagers[i]->SetFusionLevel(fusLevel); + mSlicerManagers[i]->SetOverlayColorWindow(overWindow); + mSlicerManagers[i]->SetOverlayColorLevel(overLevel); mSlicerManagers[i]->Render(); } }