From: tbaudier Date: Wed, 9 Dec 2015 15:07:22 +0000 (+0100) Subject: Remove cout and add a restriction with Qt and VTK Versions X-Git-Tag: v1.4.0~84 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=05413db25dc1daf6d79b45caa2a75668bf5e13e7;p=clitk.git Remove cout and add a restriction with Qt and VTK Versions Pre-release version --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3b2a7..0bbeb0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,8 @@ if(NOT DEFINED CLITK_SOURCE_DIR) set(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) endif(NOT DEFINED CLITK_SOURCE_DIR) #========================================================= - +SET(QT_MIN_VERSION "5.0.0") +SET(VTK_MIN_VERSION "6.0.0") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) if(MSVC) diff --git a/vv/vvBinaryImageOverlayActor.cxx b/vv/vvBinaryImageOverlayActor.cxx index 1af316d..40fba13 100644 --- a/vv/vvBinaryImageOverlayActor.cxx +++ b/vv/vvBinaryImageOverlayActor.cxx @@ -35,7 +35,7 @@ //------------------------------------------------------------------------------ vvBinaryImageOverlayActor::vvBinaryImageOverlayActor() -{ //out << __func__ << endl; +{ mTSlice = -1; mSlice = 0; mColor.resize(3); @@ -53,7 +53,7 @@ vvBinaryImageOverlayActor::vvBinaryImageOverlayActor() //------------------------------------------------------------------------------ vvBinaryImageOverlayActor::~vvBinaryImageOverlayActor() -{ //out << __func__ << endl; +{ mImageActorList.clear(); } //------------------------------------------------------------------------------ @@ -61,7 +61,7 @@ vvBinaryImageOverlayActor::~vvBinaryImageOverlayActor() //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::RemoveActors() -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mImageActorList.size(); i++) { if (mSlicer != 0) { if (mSlicer != NULL) { @@ -79,7 +79,7 @@ void vvBinaryImageOverlayActor::RemoveActors() //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::SetColor(double r, double g, double b) -{ //out << __func__ << endl; +{ mColor[0] = r; mColor[1] = g; mColor[2] = b; @@ -89,7 +89,7 @@ void vvBinaryImageOverlayActor::SetColor(double r, double g, double b) //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::SetSlicer(vvSlicer * slicer) -{ //out << __func__ << endl; +{ mSlicer = slicer; } //------------------------------------------------------------------------------ @@ -97,7 +97,7 @@ void vvBinaryImageOverlayActor::SetSlicer(vvSlicer * slicer) //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::Initialize(bool IsVisible) -{ //out << __func__ << endl; +{ if (!mSlicer) { std::cerr << "ERROR. Please use setSlicer before setSlicer in vvBinaryImageOverlayActor." << std::endl; exit(0); @@ -164,7 +164,7 @@ void vvBinaryImageOverlayActor::Initialize(bool IsVisible) //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::SetOpacity(double d) -{ //out << __func__ << endl; +{ mAlpha = d; } //------------------------------------------------------------------------------ @@ -206,7 +206,7 @@ void vvBinaryImageOverlayActor::SetOpacity(double d) //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool modeBG) -{ //out << __func__ << endl; +{ mImage = image; if (modeBG) { mBackgroundValue = bg; @@ -222,7 +222,7 @@ void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::HideActors() -{ //out << __func__ << endl; +{ if (!mSlicer) return; mSlice = mSlicer->GetSlice(); for(unsigned int i=0; iGetSlice(); mTSlice = mSlicer->GetTSlice(); @@ -252,7 +252,7 @@ void vvBinaryImageOverlayActor::ShowActors() //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::UpdateColor() -{ //out << __func__ << endl; +{ mColorLUT->SetTableValue(1, mColor[0], mColor[1], mColor[2], mAlpha); // FG for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) { // how many intensity ? @@ -271,7 +271,7 @@ void vvBinaryImageOverlayActor::UpdateColor() //------------------------------------------------------------------------------ void vvBinaryImageOverlayActor::UpdateSlice(int slicer, int slice, bool force) -{ //out << __func__ << endl; +{ if (!mSlicer) return; if (!force) { @@ -311,7 +311,7 @@ void vvBinaryImageOverlayActor::ComputeExtent(int orientation, int slice, int * inExtent, int * outExtent) -{ //out << __func__ << endl; +{ switch (orientation) { case vtkImageViewer2::SLICE_ORIENTATION_XY: for(int i=0; i<4; i++) outExtent[i] = inExtent[i]; @@ -333,7 +333,7 @@ void vvBinaryImageOverlayActor::ComputeExtent(int orientation, //---------------------------------------------------------------------------- void vvBinaryImageOverlayActor::ComputeExtent(int * inExtent, int * outExtent, vtkImageData * image, vtkImageData * overlay) -{ //out << __func__ << endl; +{ for(int i=0; i<3; i++) { double a = (image->GetOrigin()[i] + inExtent[i*2]*image->GetSpacing()[i] - overlay->GetOrigin()[i]) / overlay->GetSpacing()[i]; @@ -361,7 +361,7 @@ void vvBinaryImageOverlayActor::SetDisplayExtentAndCameraPosition(int orientatio int * extent, vtkImageActor * actor, double position) -{ //out << __func__ << endl; +{ /* FIXME Error according to camera orientation */ diff --git a/vv/vvImageContour.cxx b/vv/vvImageContour.cxx index e391bbb..1c265f3 100644 --- a/vv/vvImageContour.cxx +++ b/vv/vvImageContour.cxx @@ -31,7 +31,7 @@ //------------------------------------------------------------------------------ vvImageContour::vvImageContour() -{ //out << __func__ << endl; +{ mTSlice = -1; mSlice = 0; mHiddenImageIsUsed = false; @@ -46,7 +46,7 @@ vvImageContour::vvImageContour() //------------------------------------------------------------------------------ vvImageContour::~vvImageContour() -{ //out << __func__ << endl; +{ mSquaresActorList.clear(); } //------------------------------------------------------------------------------ @@ -54,7 +54,7 @@ vvImageContour::~vvImageContour() //------------------------------------------------------------------------------ void vvImageContour::RemoveActors() -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSquaresActorList.size(); i++) { if (mSlicer != 0) { if (mSlicer!= NULL) { @@ -72,7 +72,7 @@ void vvImageContour::RemoveActors() //------------------------------------------------------------------------------ void vvImageContour::SetSlicer(vvSlicer * slicer) -{ //out << __func__ << endl; +{ mSlicer = slicer; // Create an actor for each time slice for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) { @@ -84,7 +84,7 @@ void vvImageContour::SetSlicer(vvSlicer * slicer) //------------------------------------------------------------------------------ void vvImageContour::SetImage(vvImage::Pointer image) -{ //out << __func__ << endl; +{ for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) { #if VTK_MAJOR_VERSION <= 5 mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]); @@ -100,7 +100,7 @@ void vvImageContour::SetImage(vvImage::Pointer image) //------------------------------------------------------------------------------ void vvImageContour::SetPreserveMemoryModeEnabled(bool b) -{ //out << __func__ << endl; +{ // FastCache mode work only if threshold is always the same if (mDisplayModeIsPreserveMemory == b) return; mDisplayModeIsPreserveMemory = b; @@ -121,7 +121,7 @@ void vvImageContour::SetPreserveMemoryModeEnabled(bool b) //------------------------------------------------------------------------------ void vvImageContour::SetColor(double r, double g, double b) -{ //out << __func__ << endl; +{ for(unsigned int i=0; iGetProperty()->SetColor(r,g,b); mSquaresActorList[i]->GetProperty()->SetOpacity(0.995); @@ -132,7 +132,7 @@ void vvImageContour::SetColor(double r, double g, double b) //------------------------------------------------------------------------------ void vvImageContour::SetLineWidth(double w) -{ //out << __func__ << endl; +{ for(unsigned int i=0; iGetProperty()->SetLineWidth(w); } @@ -142,7 +142,7 @@ void vvImageContour::SetLineWidth(double w) //------------------------------------------------------------------------------ void vvImageContour::HideActors() -{ //out << __func__ << endl; +{ if (!mSlicer) return; mSlice = mSlicer->GetSlice(); for(unsigned int i=0; iGetSlice(); mTSlice = mSlicer->GetTSlice(); @@ -166,7 +166,7 @@ void vvImageContour::ShowActors() //------------------------------------------------------------------------------ void vvImageContour::SetDepth(double d) -{ //out << __func__ << endl; +{ mDepth = d; // Move the actor to be visible double position[3] = {0, 0, 0}; @@ -180,7 +180,7 @@ void vvImageContour::SetDepth(double d) //------------------------------------------------------------------------------ void vvImageContour::Update(double value) -{ //out << __func__ << endl; +{ if (!mSlicer) return; if (mPreviousValue == value) { if (mPreviousSlice == mSlicer->GetSlice()) { @@ -217,7 +217,7 @@ void vvImageContour::Update(double value) //------------------------------------------------------------------------------ void vvImageContour::UpdateWithPreserveMemoryMode() -{ //out << __func__ << endl; +{ // Only change actor visibility if tslice change mPreviousTslice = mTSlice; mTSlice = mSlicer->GetTSlice(); @@ -241,7 +241,7 @@ void vvImageContour::UpdateWithPreserveMemoryMode() //------------------------------------------------------------------------------ void vvImageContour::InitializeCacheMode() -{ //out << __func__ << endl; +{ clitkExceptionMacro("TODO : not implemented yet"); mPreviousSlice = mPreviousOrientation = 0; int dim = mSlicer->GetImage()->GetNumberOfDimensions(); @@ -260,7 +260,7 @@ clitkExceptionMacro("TODO : not implemented yet"); //------------------------------------------------------------------------------ int vvImageContour::ComputeCurrentOrientation() -{ //out << __func__ << endl; +{ // Get extent of image in the slicer int* extent = mSlicer->GetImageActor()->GetDisplayExtent(); @@ -279,7 +279,7 @@ int vvImageContour::ComputeCurrentOrientation() //------------------------------------------------------------------------------ void vvImageContour::UpdateWithFastCacheMode() -{ //out << __func__ << endl; +{ clitkExceptionMacro("TODO : not implemented yet"); // Compute orientation @@ -308,7 +308,7 @@ clitkExceptionMacro("TODO : not implemented yet"); //------------------------------------------------------------------------------ void vvImageContour::CreateNewActor(int numImage) -{ //out << __func__ << endl; +{ vtkSmartPointer squaresActor = vtkSmartPointer::New(); vtkSmartPointer clipper = vtkSmartPointer::New(); vtkSmartPointer squares = vtkSmartPointer::New(); @@ -356,7 +356,7 @@ void vvImageContour::UpdateActor(vtkActor * actor, vtkMarchingSquares * squares, vtkImageClip * clipper, double threshold, int orientation, int slice) -{ //out << __func__ << endl; +{ // Set parameter for the MarchigSquare squares->SetValue(0, threshold); squares->Update(); diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 9ee7f8c..1476dd4 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -124,7 +124,7 @@ It is distributed under dual licence //------------------------------------------------------------------------------ vvMainWindow::vvMainWindow():vvMainWindowBase() -{ //out << __func__ << endl; +{ setupUi(this); // this sets up the GUI mInputPathName = ""; @@ -387,13 +387,13 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() } //------------------------------------------------------------------------------ void vvMainWindow::show() -{ //out << __func__ << endl; +{ vvMainWindowBase::show(); PopupRegisterForm(true); } //------------------------------------------------------------------------------ void vvMainWindow::UpdateMemoryUsage() -{ //out << __func__ << endl; +{ // clitk::PrintMemory(true); if (clitk::GetMemoryUsageInMb() == 0) infoPanel->setMemoryInMb("NA"); else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB"); @@ -403,7 +403,7 @@ void vvMainWindow::UpdateMemoryUsage() //------------------------------------------------------------------------------ void vvMainWindow::createRecentlyOpenedFilesMenu() -{ //out << __func__ << endl; +{ recentlyOpenedFilesMenu = new QMenu("Recently opened files..."); recentlyOpenedFilesMenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png"))); menuFile->insertMenu(actionOpen_Image_With_Time,recentlyOpenedFilesMenu); @@ -415,7 +415,7 @@ void vvMainWindow::createRecentlyOpenedFilesMenu() //------------------------------------------------------------------------------ void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list &recent_files) -{ //out << __func__ << endl; +{ if(recentlyOpenedFilesMenu==NULL) { createRecentlyOpenedFilesMenu(); } else { @@ -432,7 +432,7 @@ void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list &r //------------------------------------------------------------------------------ void vvMainWindow::ComputeMidPosition() -{ //out << __func__ << endl; +{ bool ok; int index=GetSlicerIndexFromItem(DataTree->selectedItems()[0]); int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\ @@ -457,7 +457,7 @@ mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok); //------------------------------------------------------------------------------ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool propagation) -{ //out << __func__ << endl; +{ QTreeWidgetItem *item = new QTreeWidgetItem(); item->setData(0,Qt::UserRole,"filename.vtk"); item->setData(1,Qt::UserRole,tr("contour")); @@ -504,7 +504,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro //------------------------------------------------------------------------------ void vvMainWindow::OpenVTKContour() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size() > 0) { QString Extensions = "Images ( *.vtk *.obj)"; Extensions += ";;All Files (*)"; @@ -527,7 +527,7 @@ void vvMainWindow::OpenVTKContour() //------------------------------------------------------------------------------ void vvMainWindow::AddDCStructContour(int index, QString file) -{ //out << __func__ << endl; +{ vvMeshReader reader; reader.SetFilename(file.toStdString()); vvStructSelector selector; @@ -551,7 +551,7 @@ void vvMainWindow::AddDCStructContour(int index, QString file) //------------------------------------------------------------------------------ void vvMainWindow::OpenDCStructContour() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size() > 0) { QString Extensions = "Dicom Files ( *.dcm RS*)"; Extensions += ";;All Files (*)"; @@ -567,7 +567,7 @@ void vvMainWindow::OpenDCStructContour() //------------------------------------------------------------------------------ void vvMainWindow::ComputeDeformableRegistration() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size() > 0) { int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); vvDeformationDialog dialog(index,mSlicerManagers); @@ -584,7 +584,7 @@ void vvMainWindow::ComputeDeformableRegistration() //------------------------------------------------------------------------------ void vvMainWindow::WarpImage() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (!mSlicerManagers[index]->GetVF().IsNull()) { bool ok; @@ -601,7 +601,7 @@ void vvMainWindow::WarpImage() //------------------------------------------------------------------------------ void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phase) -{ //out << __func__ << endl; +{ if (!selected_slicer->GetVF().IsNull()) { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QFileInfo info(selected_slicer->GetFileName().c_str()); @@ -624,7 +624,7 @@ void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phas //------------------------------------------------------------------------------ vvMainWindow::~vvMainWindow() -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (mSlicerManagers[i] != NULL) delete mSlicerManagers[i]; @@ -634,7 +634,7 @@ vvMainWindow::~vvMainWindow() //------------------------------------------------------------------------------ QTabWidget * vvMainWindow::GetTab() -{ //out << __func__ << endl; +{ return tabWidget; } //------------------------------------------------------------------------------ @@ -642,7 +642,7 @@ QTabWidget * vvMainWindow::GetTab() //------------------------------------------------------------------------------ void vvMainWindow::MergeImages() -{ //out << __func__ << endl; +{ QString Extensions = EXTENSIONS; Extensions += ";;All Files (*)"; QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images"),mInputPathName,Extensions); @@ -701,7 +701,7 @@ void vvMainWindow::MergeImages() //------------------------------------------------------------------------------ void vvMainWindow::SliceImages() -{ //out << __func__ << endl; +{ QString Extensions = EXTENSIONS; Extensions += ";;All Files (*)"; @@ -718,7 +718,7 @@ void vvMainWindow::SliceImages() //------------------------------------------------------------------------------ void vvMainWindow::MergeImagesWithTime() -{ //out << __func__ << endl; +{ QString Extensions = EXTENSIONS; Extensions += ";;All Files (*)"; QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images With Time"),mInputPathName,Extensions); @@ -740,7 +740,7 @@ void vvMainWindow::MergeImagesWithTime() //------------------------------------------------------------------------------ void vvMainWindow::OpenDicom() -{ //out << __func__ << endl; +{ std::vector files; //std::cout << "dicomSeriesSelector " << std::endl; @@ -753,7 +753,7 @@ void vvMainWindow::OpenDicom() //------------------------------------------------------------------------------ void vvMainWindow::OpenImages() -{ //out << __func__ << endl; +{ QString Extensions = EXTENSIONS; Extensions += ";;All Files (*)"; @@ -768,7 +768,7 @@ void vvMainWindow::OpenImages() } //------------------------------------------------------------------------------ void vvMainWindow::OpenRecentImage() -{ //out << __func__ << endl; +{ QAction * caller = qobject_cast(sender()); std::vector images; images.push_back(caller->text().toStdString()); @@ -780,7 +780,7 @@ void vvMainWindow::OpenRecentImage() //------------------------------------------------------------------------------ void vvMainWindow::OpenImageWithTime() -{ //out << __func__ << endl; +{ QString Extensions = EXTENSIONS; Extensions += ";;All Files (*)"; @@ -799,7 +799,7 @@ void vvMainWindow::OpenImageWithTime() //------------------------------------------------------------------------------ void vvMainWindow::LoadImages(std::vector files, vvImageReader::LoadedImageType filetype) -{ //out << __func__ << endl; +{ //Separate the way to open images and dicoms int fileSize; if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME) @@ -974,7 +974,7 @@ void vvMainWindow::LoadImages(std::vector files, vvImageReader::Loa //------------------------------------------------------------------------------ void vvMainWindow::UpdateTree() -{ //out << __func__ << endl; +{ DataTree->resizeColumnToContents(COLUMN_TREE); DataTree->resizeColumnToContents(COLUMN_UL_VIEW); DataTree->resizeColumnToContents(COLUMN_UR_VIEW); @@ -988,7 +988,7 @@ void vvMainWindow::UpdateTree() //------------------------------------------------------------------------------ void vvMainWindow::CurrentImageChanged(std::string id) -{ //out << __func__ << endl; +{ if (id == mCurrentSelectedImageId) return; // Do nothing int selected = 0; for (int i = 0; i < DataTree->topLevelItemCount(); i++) { @@ -1015,7 +1015,7 @@ void vvMainWindow::CurrentImageChanged(std::string id) //------------------------------------------------------------------------------ void vvMainWindow::CurrentPickedImageChanged(std::string id) -{ //out << __func__ << endl; +{ if (id == mCurrentPickedImageId) return; // Do nothing int selected = 0; for (int i = 0; i < DataTree->topLevelItemCount(); i++) { @@ -1036,7 +1036,7 @@ void vvMainWindow::CurrentPickedImageChanged(std::string id) //------------------------------------------------------------------------------ void vvMainWindow::ImageInfoChanged() -{ //out << __func__ << endl; +{ contextActions[6]->setEnabled(1); contextActions[5]->setEnabled(1); actionSave_As->setEnabled(1); @@ -1214,14 +1214,14 @@ void vvMainWindow::ImageInfoChanged() //------------------------------------------------------------------------------ void vvMainWindow::ShowDocumentation() -{ //out << __func__ << endl; +{ documentation->show(); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::PopupRegisterForm(bool checkCanPush) -{ //out << __func__ << endl; +{ vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat()); if(!checkCanPush) { registerForm->show(); @@ -1236,14 +1236,14 @@ void vvMainWindow::PopupRegisterForm(bool checkCanPush) //------------------------------------------------------------------------------ void vvMainWindow::ShowHelpDialog() -{ //out << __func__ << endl; +{ help_dialog->show(); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::ChangeViewMode() -{ //out << __func__ << endl; +{ typedef struct _SIZE{ QSplitter* splitter; QList size1, size2; @@ -1327,7 +1327,7 @@ void vvMainWindow::ChangeViewMode() //------------------------------------------------------------------------------ QString vvMainWindow::GetSizeInBytes(unsigned long size) -{ //out << __func__ << endl; +{ QString result = "";// QString::number(size); //result += " bytes ("; if (size > 1000000000) { @@ -1349,7 +1349,7 @@ QString vvMainWindow::GetSizeInBytes(unsigned long size) //------------------------------------------------------------------------------ QString vvMainWindow::GetVectorDoubleAsString(std::vector vectorDouble) -{ //out << __func__ << endl; +{ QString result; for (unsigned int i= 0; i < vectorDouble.size(); i++) { if (i != 0) @@ -1362,7 +1362,7 @@ QString vvMainWindow::GetVectorDoubleAsString(std::vector vectorDouble) //------------------------------------------------------------------------------ QString vvMainWindow::GetVectorIntAsString(std::vector vectorInt) -{ //out << __func__ << endl; +{ QString result; for (unsigned int i= 0; i < vectorInt.size(); i++) { if (i != 0) @@ -1376,7 +1376,7 @@ QString vvMainWindow::GetVectorIntAsString(std::vector vectorInt) //------------------------------------------------------------------------------ //this actually returns the SlicerManager index! int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item) -{ //out << __func__ << endl; +{ QString id = item->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString(); for (int i = 0; i < DataTree->topLevelItemCount(); i++) { if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id) @@ -1388,7 +1388,7 @@ int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item) //------------------------------------------------------------------------------ QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm) -{ //out << __func__ << endl; +{ QString id = sm->GetId().c_str(); for (int i = 0; i < DataTree->topLevelItemCount(); i++) { if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id) @@ -1400,7 +1400,7 @@ QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm) //------------------------------------------------------------------------------ void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column) -{ //out << __func__ << endl; +{ if ( column >= COLUMN_CLOSE_IMAGE || column <= 0) return; @@ -1468,7 +1468,7 @@ void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column) //------------------------------------------------------------------------------ void vvMainWindow::InitSlicers() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size()) { mSlicerManagers.back()->GenerateDefaultLookupTable(); mSlicerManagers.back()->SetSlicerWindow(0,NOViewWidget->GetRenderWindow()); @@ -1481,7 +1481,7 @@ void vvMainWindow::InitSlicers() //------------------------------------------------------------------------------ void vvMainWindow::InitDisplay() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size()) { //BE CAREFUL : this is absolutely necessary to set the interactor style //in order to have the same style instanciation for all SlicerManagers in @@ -1516,7 +1516,7 @@ void vvMainWindow::InitDisplay() //------------------------------------------------------------------------------ void vvMainWindow::DisplaySliders(int slicer, int window) -{ //out << __func__ << endl; +{ if(!mSlicerManagers[slicer]->GetSlicer(window)->GetRenderer()->GetDraw()) return; @@ -1545,7 +1545,7 @@ void vvMainWindow::DisplaySliders(int slicer, int window) //------------------------------------------------------------------------------ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column) -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(item); if (DataTree->topLevelItem(index) != item) { @@ -1663,7 +1663,7 @@ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column) //------------------------------------------------------------------------------ void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column) -{ //out << __func__ << endl; +{ // int index = GetSlicerIndexFromItem(item); // QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); // if (item->data(1,Qt::UserRole).toString() == "vector") @@ -1703,28 +1703,28 @@ void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column) //------------------------------------------------------------------------------ void vvMainWindow::MousePositionChanged(int visibility,double x, double y, double z, double X, double Y, double Z , double value) -{ //out << __func__ << endl; +{ infoPanel->setCurrentInfo(visibility,x,y,z,X,Y,Z,value); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::VectorChanged(int visibility,double x, double y, double z, double value) -{ //out << __func__ << endl; +{ overlayPanel->getCurrentVectorInfo(visibility,x,y,z,value); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::OverlayChanged(int visibility, double valueOver, double valueRef) -{ //out << __func__ << endl; +{ overlayPanel->getCurrentOverlayInfo(visibility,valueOver, valueRef); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::FusionChanged(int visibility, double value) -{ //out << __func__ << endl; +{ overlayPanel->getCurrentFusionInfo(visibility,value); } //------------------------------------------------------------------------------ @@ -1734,7 +1734,7 @@ void vvMainWindow::FusionChanged(int visibility, double value) //or when UpdateWindowLevel() is called ; when slicerManager emits WindowLevelChanged //when ImageInfoChanged() is called void vvMainWindow::WindowLevelChanged() -{ //out << __func__ << endl; +{ // Base image int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if(index==-1) return; @@ -1789,7 +1789,7 @@ void vvMainWindow::WindowLevelChanged() //------------------------------------------------------------------------------ void vvMainWindow::WindowLevelEdited() -{ //out << __func__ << endl; +{ presetComboBox->setCurrentIndex(WL_USER); UpdateWindowLevel(); } @@ -1797,7 +1797,7 @@ void vvMainWindow::WindowLevelEdited() //------------------------------------------------------------------------------ void vvMainWindow::SetWindowLevel(double w, double l) -{ //out << __func__ << endl; +{ windowSpinBox->setValue(w); levelSpinBox->setValue(l); presetComboBox->setCurrentIndex(WL_USER); @@ -1808,7 +1808,7 @@ void vvMainWindow::SetWindowLevel(double w, double l) //------------------------------------------------------------------------------ void vvMainWindow::UpdateWindowLevel() -{ //out << __func__ << endl; +{ if (DataTree->selectedItems().size()) { if (presetComboBox->currentIndex() == WL_VENTILATION) //For ventilation colorMapComboBox->setCurrentIndex(5); @@ -1824,7 +1824,7 @@ void vvMainWindow::UpdateWindowLevel() //------------------------------------------------------------------------------ void vvMainWindow::UpdateSlicingPreset() -{ //out << __func__ << endl; +{ if (DataTree->selectedItems().size()) { int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); mSlicerManagers[index]->SetSlicingPreset(vvSlicerManager::SlicingPresetType(slicingPresetComboBox->currentIndex())); @@ -1834,7 +1834,7 @@ void vvMainWindow::UpdateSlicingPreset() //------------------------------------------------------------------------------ void vvMainWindow::UpdateColorMap() -{ //out << __func__ << endl; +{ if (DataTree->selectedItems().size()) { int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); mSlicerManagers[index]->SetColorMap(colorMapComboBox->currentIndex()); @@ -1843,7 +1843,7 @@ void vvMainWindow::UpdateColorMap() } //------------------------------------------------------------------------------ void vvMainWindow::SwitchWindowLevel() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); int window = mSlicerManagers[index]->GetColorWindow(); presetComboBox->setCurrentIndex(WL_USER); @@ -1854,7 +1854,7 @@ void vvMainWindow::SwitchWindowLevel() //------------------------------------------------------------------------------ void vvMainWindow::ApplyWindowLevelToAllImages() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if(index==-1) return; double window = mSlicerManagers[index]->GetColorWindow(); @@ -1883,7 +1883,7 @@ void vvMainWindow::ApplyWindowLevelToAllImages() //------------------------------------------------------------------------------ void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin, unsigned int indexMax) -{ //out << __func__ << endl; +{ for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) { if (mSlicerManagers[i] == NULL) continue; @@ -1896,7 +1896,7 @@ void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin //------------------------------------------------------------------------------ void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin, unsigned int indexMax) -{ //out << __func__ << endl; +{ for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) { if (mSlicerManagers[i] == NULL) continue; @@ -1909,7 +1909,7 @@ void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin, //------------------------------------------------------------------------------ void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps) -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (mSlicerManagers[i]->GetId() == id) { mSlicerManagers[i]->GetSlicer(slicer)->SetCurrentPosition(x,y,z,temps); @@ -1922,7 +1922,7 @@ void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, doubl //------------------------------------------------------------------------------ void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm, vvSlicer* refSlicer) -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (id == mSlicerManagers[i]->GetId()) { mSlicerManagers[i]->UpdateLinkedNavigation(refSlicer); @@ -1933,7 +1933,7 @@ void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm, //------------------------------------------------------------------------------ void vvMainWindow::ShowContextMenu(QPoint point) -{ //out << __func__ << endl; +{ if (!DataTree->selectedItems().size()) { contextActions[1]->setEnabled(0); contextActions[2]->setEnabled(0); @@ -1962,21 +1962,21 @@ void vvMainWindow::ShowContextMenu(QPoint point) //------------------------------------------------------------------------------ void vvMainWindow::CloseImage() -{ //out << __func__ << endl; +{ CloseImage(DataTree->selectedItems()[0],0); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::ReloadImage() -{ //out << __func__ << endl; +{ ReloadImage(DataTree->selectedItems()[0],0); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::SelectOverlayImage() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); //check if one overlay image is added @@ -2006,7 +2006,7 @@ void vvMainWindow::SelectOverlayImage() //------------------------------------------------------------------------------ void vvMainWindow::AddOverlayImage(int index, std::vector fileNames, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ QString file(fileNames[0].c_str()); if (QFile::exists(file)) { @@ -2086,7 +2086,7 @@ void vvMainWindow::AddOverlayImage(int index, std::vector fileNames //------------------------------------------------------------------------------ void vvMainWindow::AddROI(int index, QString file) -{ //out << __func__ << endl; +{ /* // Get slice manager @@ -2113,7 +2113,7 @@ void vvMainWindow::AddROI(int index, QString file) //------------------------------------------------------------------------------ void vvMainWindow::SelectFusionImage() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); //check if one fusion image is added @@ -2143,7 +2143,7 @@ void vvMainWindow::SelectFusionImage() //------------------------------------------------------------------------------ void vvMainWindow::ResetTransformationToIdentity() -{ //out << __func__ << endl; +{ std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString(); int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); mSlicerManagers[index]->ResetTransformationToIdentity(actorType); @@ -2153,7 +2153,7 @@ void vvMainWindow::ResetTransformationToIdentity() //------------------------------------------------------------------------------ void vvMainWindow::AddFusionImage(int index, std::vector fileNames, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ QString file(fileNames[0].c_str()); if (QFile::exists(file)) { @@ -2231,7 +2231,7 @@ void vvMainWindow::AddFusionImage(int index, std::vector fileNames, //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvMainWindow::AddLandmarks(int index, std::vector files) -{ //out << __func__ << endl; +{ if (!landmarksPanel->LoadFromFile(files)) QMessageBox::information(this,tr("Problem reading Landmarks !"),"File doesn't exist!"); @@ -2241,7 +2241,7 @@ void vvMainWindow::AddLandmarks(int index, std::vector files) //------------------------------------------------------------------------------ void vvMainWindow::OpenField() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); //check if a vector field has already been added for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++) @@ -2269,7 +2269,7 @@ void vvMainWindow::OpenField() //------------------------------------------------------------------------------ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk) -{ //out << __func__ << endl; +{ //create an item in the tree with good settings QTreeWidgetItem *item = new QTreeWidgetItem(); item->setData(0,Qt::UserRole,filename.toStdString().c_str()); @@ -2320,7 +2320,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk) //------------------------------------------------------------------------------ void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index) -{ //out << __func__ << endl; +{ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); vvSlicerManager* imageManager = mSlicerManagers[index]; if (imageManager->SetVF(vf,file.toStdString())) { @@ -2337,7 +2337,7 @@ void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index) //------------------------------------------------------------------------------ void vvMainWindow::AddField(QString file,int index) -{ //out << __func__ << endl; +{ if (QFile::exists(file)) { mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str(); @@ -2369,7 +2369,7 @@ void vvMainWindow::AddField(QString file,int index) //------------------------------------------------------------------------------ void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width, double r, double g, double b) -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (mSlicerManagers[index]->GetSlicer(0)->GetVF()) { for (int i = 0; i < 4; i++) { @@ -2389,7 +2389,7 @@ void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width, //------------------------------------------------------------------------------ void vvMainWindow::SetOverlayProperty(int color, int linked, double window, double level) -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) { mSlicerManagers[index]->SetOverlayColor(color); @@ -2404,7 +2404,7 @@ void vvMainWindow::SetOverlayProperty(int color, int linked, double window, doub //------------------------------------------------------------------------------ void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level, bool showLegend) -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) { mSlicerManagers[index]->SetFusionColorMap(colormap); @@ -2422,7 +2422,7 @@ void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap //------------------------------------------------------------------------------ void vvMainWindow::SelectFusionSequence() -{ //out << __func__ << endl; +{ //get the index of the slicer manager of the main sequence (CT) int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); //check if one overlay image is already associated @@ -2455,7 +2455,7 @@ void vvMainWindow::SelectFusionSequence() //------------------------------------------------------------------------------ void vvMainWindow::SelectFusionSequenceCorrespondances() -{ //out << __func__ << endl; +{ //make sure the index is right? //in the end, I should attach the temporal data to the right sequence! int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); @@ -2519,7 +2519,7 @@ void vvMainWindow::SelectFusionSequenceCorrespondances() //when this function is called index is the slicer manager index corresponding to the main sequence (CT) //the files behind fileNames points to the data for the secondary sequence void vvMainWindow::AddFusionSequence(int index, std::vector fileNames, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ QString file(fileNames[0].c_str()); if (QFile::exists(file)) { @@ -2640,7 +2640,7 @@ void vvMainWindow::AddFusionSequence(int index, std::vector fileNam //------------------------------------------------------------------------------ //fusionSequenceFrameIndex and fusionSequenceNbFrames are relative to the secondary sequence (US) void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool spatialSyncFlag, unsigned int fusionSequenceNbFrames, bool temporalSyncFlag) -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); if (!mSlicerManagers[index]->IsInvolvedInFusionSequence()) return; @@ -2720,7 +2720,7 @@ void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool //------------------------------------------------------------------------------ void vvMainWindow::SaveAs() -{ //out << __func__ << endl; +{ if (DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString() == "vector") { QMessageBox::warning(this,tr("Unsupported type"),tr("Sorry, saving a vector field is unsupported for the moment")); return; @@ -2824,7 +2824,7 @@ void vvMainWindow::SaveAs() //------------------------------------------------------------------------------ void vvMainWindow::SaveCurrentState() -{ //out << __func__ << endl; +{ QString Extensions = "XML Files(*.xml)"; QString fileName = QFileDialog::getSaveFileName(this, tr("Save Current Window State"), @@ -2837,14 +2837,14 @@ void vvMainWindow::SaveCurrentState() //------------------------------------------------------------------------------ void vvMainWindow::SaveCurrentStateAs(const std::string& stateFile) -{ //out << __func__ << endl; +{ vvSaveState save_state; save_state.Run(this, stateFile); } //------------------------------------------------------------------------------ void vvMainWindow::ReadSavedState() -{ //out << __func__ << endl; +{ QString Extensions = "XML Files(*.xml)"; QString fileName = QFileDialog::getOpenFileName(this, tr("Load Window State"), @@ -2857,7 +2857,7 @@ void vvMainWindow::ReadSavedState() //------------------------------------------------------------------------------ void vvMainWindow::ReadSavedStateFile(const std::string& stateFile) -{ //out << __func__ << endl; +{ vvReadState read_state; read_state.Run(this, stateFile); } @@ -2865,13 +2865,13 @@ void vvMainWindow::ReadSavedStateFile(const std::string& stateFile) //------------------------------------------------------------------------------ void vvMainWindow::LinkAllImages() -{ //out << __func__ << endl; +{ linkPanel->linkAll(); } //------------------------------------------------------------------------------ void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel) -{ //out << __func__ << endl; +{ if (!fromPanel) { // delegate to linkPanel if call came from elsewhere... linkPanel->addLinkFromIds(image1, image2); @@ -2905,7 +2905,7 @@ void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel) //------------------------------------------------------------------------------ void vvMainWindow::RemoveLink(QString image1,QString image2) -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (image1.toStdString() == mSlicerManagers[i]->GetId()) { mSlicerManagers[i]->RemoveLink(image2.toStdString()); @@ -2919,7 +2919,7 @@ void vvMainWindow::RemoveLink(QString image1,QString image2) //------------------------------------------------------------------------------ void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset) -{ //out << __func__ << endl; +{ if(mSlicerManagers.size()==1) return; @@ -2935,7 +2935,7 @@ void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, i } //------------------------------------------------------------------------------ void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index) -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { if (DataTree->topLevelItem(i)->data(column,Qt::CheckStateRole).toInt() > 1) { //i is the SlicerManager that is in charge of this slicer. @@ -2972,7 +2972,7 @@ void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index) //------------------------------------------------------------------------------ void vvMainWindow::NOHorizontalSliderMoved() -{ //out << __func__ << endl; +{ // if (mCurrentTime == NOHorizontalSlider->value()) return; HorizontalSliderMoved(NOHorizontalSlider->value(),COLUMN_UL_VIEW,0); // mCurrentTime = NOHorizontalSlider->value(); @@ -2982,7 +2982,7 @@ void vvMainWindow::NOHorizontalSliderMoved() //------------------------------------------------------------------------------ void vvMainWindow::NEHorizontalSliderMoved() -{ //out << __func__ << endl; +{ // if (mCurrentTime == NEHorizontalSlider->value()) return; HorizontalSliderMoved(NEHorizontalSlider->value(),COLUMN_UR_VIEW,1); // mCurrentTime = NEHorizontalSlider->value(); @@ -2992,7 +2992,7 @@ void vvMainWindow::NEHorizontalSliderMoved() //------------------------------------------------------------------------------ void vvMainWindow::SOHorizontalSliderMoved() -{ //out << __func__ << endl; +{ // if (mCurrentTime == SOHorizontalSlider->value()) return; HorizontalSliderMoved(SOHorizontalSlider->value(),COLUMN_DL_VIEW,2); // mCurrentTime = SOHorizontalSlider->value(); @@ -3002,7 +3002,7 @@ void vvMainWindow::SOHorizontalSliderMoved() //------------------------------------------------------------------------------ void vvMainWindow::SEHorizontalSliderMoved() -{ //out << __func__ << endl; +{ // if (mCurrentTime == SEHorizontalSlider->value()) return; HorizontalSliderMoved(SEHorizontalSlider->value(),COLUMN_DR_VIEW,3); // mCurrentTime = SEHorizontalSlider->value(); @@ -3011,7 +3011,7 @@ void vvMainWindow::SEHorizontalSliderMoved() //------------------------------------------------------------------------------ void vvMainWindow::NOVerticalSliderChanged() -{ //out << __func__ << endl; +{ static int value=-1; if (value == NOVerticalSlider->value()) return; else value = NOVerticalSlider->value(); @@ -3037,7 +3037,7 @@ void vvMainWindow::NOVerticalSliderChanged() //------------------------------------------------------------------------------ void vvMainWindow::NEVerticalSliderChanged() -{ //out << __func__ << endl; +{ static int value=-1; if (value == NEVerticalSlider->value()) return; else value = NEVerticalSlider->value(); @@ -3059,7 +3059,7 @@ void vvMainWindow::NEVerticalSliderChanged() //------------------------------------------------------------------------------ void vvMainWindow::SOVerticalSliderChanged() -{ //out << __func__ << endl; +{ static int value=-1; if (value == SOVerticalSlider->value()) return; else value = SOVerticalSlider->value(); @@ -3082,7 +3082,7 @@ void vvMainWindow::SOVerticalSliderChanged() //------------------------------------------------------------------------------ void vvMainWindow::SEVerticalSliderChanged() -{ //out << __func__ << endl; +{ static int value=-1; if (value == SEVerticalSlider->value()) return; else value = SEVerticalSlider->value(); @@ -3104,7 +3104,7 @@ void vvMainWindow::SEVerticalSliderChanged() //------------------------------------------------------------------------------ void vvMainWindow::UpdateSlice(int slicer, int slice) -{ //out << __func__ << endl; +{ // DD("vvMainWindow::UpdateSlice"); // DD(slicer); // DD(slice); @@ -3130,7 +3130,7 @@ void vvMainWindow::UpdateSlice(int slicer, int slice) //------------------------------------------------------------------------------ void vvMainWindow::UpdateTSlice(int slicer, int slice, int code) -{ //out << __func__ << endl; +{ //FusionSequence: the slider value should be updated for slicers which show the same sequence as requested bool doUpdate=false; if (code==-1) doUpdate=true; @@ -3169,7 +3169,7 @@ void vvMainWindow::UpdateTSlice(int slicer, int slice, int code) //------------------------------------------------------------------------------ void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax) -{ //out << __func__ << endl; +{ //int position = int((min+max)/2); int position = mSlicerManagers[mCurrentPickedImageIndex]->GetSlicer(slicer)->GetSlice(); if (slicer == 0) { @@ -3195,7 +3195,7 @@ void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int //------------------------------------------------------------------------------ void vvMainWindow::SaveNOScreenshot() -{ //out << __func__ << endl; +{ SaveScreenshot(NOViewWidget); } //------------------------------------------------------------------------------ @@ -3203,7 +3203,7 @@ void vvMainWindow::SaveNOScreenshot() //------------------------------------------------------------------------------ void vvMainWindow::SaveNEScreenshot() -{ //out << __func__ << endl; +{ SaveScreenshot(NEViewWidget); } //------------------------------------------------------------------------------ @@ -3211,7 +3211,7 @@ void vvMainWindow::SaveNEScreenshot() //------------------------------------------------------------------------------ void vvMainWindow::SaveSOScreenshot() -{ //out << __func__ << endl; +{ SaveScreenshot(SOViewWidget); } //------------------------------------------------------------------------------ @@ -3219,7 +3219,7 @@ void vvMainWindow::SaveSOScreenshot() //------------------------------------------------------------------------------ void vvMainWindow::SaveSEScreenshot() -{ //out << __func__ << endl; +{ SaveScreenshot(SEViewWidget); } //------------------------------------------------------------------------------ @@ -3227,7 +3227,7 @@ void vvMainWindow::SaveSEScreenshot() //------------------------------------------------------------------------------ void vvMainWindow::SaveScreenshotAllSlices() -{ //out << __func__ << endl; +{ QVTKWidget *widget = NOViewWidget; int index = 0;// GetSlicerIndexFromItem(DataTree->selectedItems()[0]); @@ -3281,7 +3281,7 @@ void vvMainWindow::SaveScreenshotAllSlices() //------------------------------------------------------------------------------ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) -{ //out << __func__ << endl; +{ QString Extensions = "Images( *.png);;"; Extensions += "Images( *.jpg);;"; Extensions += "Images( *.bmp);;"; @@ -3433,7 +3433,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) //------------------------------------------------------------------------------ void vvMainWindow::GoToCursor() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); for (int column = 1; column < 5; column++) { if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) { @@ -3450,7 +3450,7 @@ void vvMainWindow::GoToCursor() //------------------------------------------------------------------------------ void vvMainWindow::GoToLandmark() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); for (int column = 1; column < 5; column++) { if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) { @@ -3467,7 +3467,7 @@ void vvMainWindow::GoToLandmark() //------------------------------------------------------------------------------ void vvMainWindow::PlayPause() -{ //out << __func__ << endl; +{ if (playMode) { playMode = 0; playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png"))); @@ -3492,7 +3492,7 @@ void vvMainWindow::PlayPause() //------------------------------------------------------------------------------ void vvMainWindow::PlayNext() -{ //out << __func__ << endl; +{ if (playMode && !this->isHidden()) { int image_number=DataTree->topLevelItemCount(); ///Only play one slicer per SM, and only if the SM is being displayed @@ -3509,7 +3509,7 @@ void vvMainWindow::PlayNext() //------------------------------------------------------------------------------ void vvMainWindow::ShowLastImage() -{ //out << __func__ << endl; +{ if (mSlicerManagers.size() > 1) { QTreeWidgetItem * item=DataTree->topLevelItem(DataTree->topLevelItemCount()-1); CurrentImageChanged(mSlicerManagers.back()->GetId()); //select new image @@ -3521,7 +3521,7 @@ void vvMainWindow::ShowLastImage() //------------------------------------------------------------------------------ void vvMainWindow::UpdateRenderWindows() -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSlicerManagers.size(); i++) { mSlicerManagers[i]->GetSlicer(0)->UpdateLandmarks(); mSlicerManagers[i]->GetSlicer(1)->UpdateLandmarks(); @@ -3537,7 +3537,7 @@ void vvMainWindow::UpdateRenderWindows() //------------------------------------------------------------------------------ void vvMainWindow::SegmentationOnCurrentImage() -{ //out << __func__ << endl; +{ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); vvSegmentationDialog segmentation; @@ -3547,7 +3547,7 @@ void vvMainWindow::SegmentationOnCurrentImage() //------------------------------------------------------------------------------ void vvMainWindow::SurfaceViewerLaunch() -{ //out << __func__ << endl; +{ vvSurfaceViewerDialog surfaceViewer; surfaceViewer.exec(); } @@ -3556,7 +3556,7 @@ void vvMainWindow::SurfaceViewerLaunch() //------------------------------------------------------------------------------ int vvMainWindow::GetImageDuplicateFilenameNumber(std::string filename) -{ //out << __func__ << endl; +{ int number=0; for(unsigned int l=0; lselectedItems().size() > 0) { index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]); diff --git a/vv/vvROIActor.cxx b/vv/vvROIActor.cxx index 26f13f4..8561a25 100644 --- a/vv/vvROIActor.cxx +++ b/vv/vvROIActor.cxx @@ -32,7 +32,7 @@ //------------------------------------------------------------------------------ vvROIActor::vvROIActor() -{ //out << __func__ << endl; +{ mIsVisible = true; mIsContourVisible = false; mOpacity = 0.5; @@ -52,14 +52,14 @@ vvROIActor::vvROIActor() //------------------------------------------------------------------------------ vvROIActor::~vvROIActor() -{ //out << __func__ << endl; +{ } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvROIActor::RemoveActors() -{ //out << __func__ << endl; +{ for(unsigned int i= 0; iRemoveActors(); } @@ -77,7 +77,7 @@ void vvROIActor::RemoveActors() //------------------------------------------------------------------------------ void vvROIActor::SetROI(clitk::DicomRT_ROI * s) -{ //out << __func__ << endl; +{ mROI = s; } //------------------------------------------------------------------------------ @@ -85,7 +85,7 @@ void vvROIActor::SetROI(clitk::DicomRT_ROI * s) //------------------------------------------------------------------------------ void vvROIActor::SetContourWidth(int n) -{ //out << __func__ << endl; +{ mContourWidth = n; } //------------------------------------------------------------------------------ @@ -93,7 +93,7 @@ void vvROIActor::SetContourWidth(int n) //------------------------------------------------------------------------------ void vvROIActor::SetSlicerManager(vvSlicerManager * s) -{ //out << __func__ << endl; +{ mSlicerManager = s; } //------------------------------------------------------------------------------ @@ -101,7 +101,7 @@ void vvROIActor::SetSlicerManager(vvSlicerManager * s) //------------------------------------------------------------------------------ void vvROIActor::UpdateImage() -{ //out << __func__ << endl; +{ mOverlayActors.clear(); mImageContour.clear(); Initialize(mDepth, mIsVisible); @@ -112,7 +112,7 @@ void vvROIActor::UpdateImage() //------------------------------------------------------------------------------ void vvROIActor::SetVisible(bool b) -{ //out << __func__ << endl; +{ mIsVisible = b; if (!b) { // remove actor for(unsigned int i= 0; iGetImage()) { mImageContour.clear(); mOverlayActors.clear(); @@ -211,7 +211,7 @@ void vvROIActor::Initialize(double depth, bool IsVisible) //------------------------------------------------------------------------------ void vvROIActor::SetDepth(double d) -{ //out << __func__ << endl; +{ mDepth = d; if (!mSlicerManager) return; for(int i=0; iGetNumberOfSlicers(); i++) { @@ -225,7 +225,7 @@ void vvROIActor::SetDepth(double d) //------------------------------------------------------------------------------ void vvROIActor::Update(bool force) -{ //out << __func__ << endl; +{ if (!mSlicerManager) return; for(int i=0; iGetNumberOfSlicers(); i++) { UpdateSlice(i, mSlicerManager->GetSlicer(i)->GetSlice(), force); @@ -236,7 +236,7 @@ void vvROIActor::Update(bool force) //------------------------------------------------------------------------------ void vvROIActor::UpdateSlice(int slicer, int slices, bool force) -{ //out << __func__ << endl; +{ if (!mROI->GetImage()) return; if ((!mIsVisible) && (!mIsContourVisible)) return; if (!mSlicerManager) { @@ -256,7 +256,7 @@ void vvROIActor::UpdateSlice(int slicer, int slices, bool force) //------------------------------------------------------------------------------ void vvROIActor::SetOpacity(double d) -{ //out << __func__ << endl; +{ mOpacity = d; } //------------------------------------------------------------------------------ @@ -264,7 +264,7 @@ void vvROIActor::SetOpacity(double d) //------------------------------------------------------------------------------ void vvROIActor::SetContourColor(double r, double v, double b) -{ //out << __func__ << endl; +{ mContourColor[0] = r; mContourColor[1] = v; mContourColor[2] = b; @@ -274,7 +274,7 @@ void vvROIActor::SetContourColor(double r, double v, double b) //------------------------------------------------------------------------------ void vvROIActor::SetOverlayColor(double r, double v, double b) -{ //out << __func__ << endl; +{ if (mROI) mROI->SetDisplayColor(r,v,b); } @@ -283,7 +283,7 @@ void vvROIActor::SetOverlayColor(double r, double v, double b) //------------------------------------------------------------------------------ std::vector & vvROIActor::GetContourColor() -{ //out << __func__ << endl; +{ return mContourColor; } //------------------------------------------------------------------------------ @@ -291,7 +291,7 @@ std::vector & vvROIActor::GetContourColor() //------------------------------------------------------------------------------ std::vector & vvROIActor::GetOverlayColor() -{ //out << __func__ << endl; +{ return mROI->GetDisplayColor(); } //------------------------------------------------------------------------------ @@ -299,7 +299,7 @@ std::vector & vvROIActor::GetOverlayColor() //------------------------------------------------------------------------------ void vvROIActor::UpdateColor() -{ //out << __func__ << endl; +{ for(unsigned int i=0; iSetOpacity(mOpacity); mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0], @@ -319,7 +319,7 @@ void vvROIActor::UpdateColor() //------------------------------------------------------------------------------ double vvROIActor::GetOpacity() -{ //out << __func__ << endl; +{ return mOpacity; } //------------------------------------------------------------------------------ @@ -327,7 +327,7 @@ double vvROIActor::GetOpacity() //------------------------------------------------------------------------------ void vvROIActor::SetSelected(bool b) -{ //out << __func__ << endl; +{ mIsSelected = b; if (b) { for(int i=0; iGetNumberOfSlicers(); i++) { @@ -345,7 +345,7 @@ void vvROIActor::SetSelected(bool b) //------------------------------------------------------------------------------ void vvROIActor::CopyParameters(QSharedPointer roi) -{ //out << __func__ << endl; +{ // Overlay SetVisible(roi->IsVisible()); SetOpacity(roi->GetOpacity()); diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 3773aa0..575fdac 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -90,7 +90,7 @@ static void copyExtent(int* in, int* to){ } //------------------------------------------------------------------------------ vvSlicer::vvSlicer() -{ //out << __func__ << endl; +{ mFusionSequenceCode = -1; this->UnInstallPipeline(); mImage = NULL; @@ -176,7 +176,7 @@ vvSlicer::vvSlicer() //------------------------------------------------------------------------------ vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() -{ //out << __func__ << endl; +{ return mOverlayMapper.GetPointer(); } //------------------------------------------------------------------------------ @@ -184,7 +184,7 @@ vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() //------------------------------------------------------------------------------ vvBlendImageActor* vvSlicer::GetOverlayActor() -{ //out << __func__ << endl; +{ return mOverlayActor.GetPointer(); } //------------------------------------------------------------------------------ @@ -192,7 +192,7 @@ vvBlendImageActor* vvSlicer::GetOverlayActor() //------------------------------------------------------------------------------ vtkImageMapToColors* vvSlicer::GetFusionMapper() -{ //out << __func__ << endl; +{ return mFusionMapper.GetPointer(); } //------------------------------------------------------------------------------ @@ -200,7 +200,7 @@ vtkImageMapToColors* vvSlicer::GetFusionMapper() //------------------------------------------------------------------------------ vtkImageActor* vvSlicer::GetFusionActor() -{ //out << __func__ << endl; +{ return mFusionActor.GetPointer(); } //------------------------------------------------------------------------------ @@ -208,7 +208,7 @@ vtkImageActor* vvSlicer::GetFusionActor() //------------------------------------------------------------------------------ vtkActor* vvSlicer::GetVFActor() -{ //out << __func__ << endl; +{ return mVFActor.GetPointer(); } //------------------------------------------------------------------------------ @@ -216,7 +216,7 @@ vtkActor* vvSlicer::GetVFActor() //------------------------------------------------------------------------------ vtkCornerAnnotation* vvSlicer::GetAnnotation() -{ //out << __func__ << endl; +{ return ca.GetPointer(); } //------------------------------------------------------------------------------ @@ -224,7 +224,7 @@ vtkCornerAnnotation* vvSlicer::GetAnnotation() //------------------------------------------------------------------------------ void vvSlicer::EnableReducedExtent(bool b) -{ //out << __func__ << endl; +{ mUseReducedExtent = b; } //------------------------------------------------------------------------------ @@ -232,7 +232,7 @@ void vvSlicer::EnableReducedExtent(bool b) //------------------------------------------------------------------------------ void vvSlicer::SetReducedExtent(int * ext) -{ //out << __func__ << endl; +{ copyExtent(ext, mReducedExtent); } //------------------------------------------------------------------------------ @@ -240,7 +240,7 @@ void vvSlicer::SetReducedExtent(int * ext) //------------------------------------------------------------------------------ void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate) -{ //out << __func__ << endl; +{ mSurfaceCutActors.push_back(new vvMeshActor()); if (propagate) @@ -257,7 +257,7 @@ void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate) //------------------------------------------------------------------------------ void vvSlicer::ToggleContourSuperposition() -{ //out << __func__ << endl; +{ for (std::vector::iterator i=mSurfaceCutActors.begin(); i!=mSurfaceCutActors.end(); i++) (*i)->ToggleSuperposition(); @@ -267,7 +267,7 @@ void vvSlicer::ToggleContourSuperposition() //------------------------------------------------------------------------------ void vvSlicer::SetCursorColor(int r,int g, int b) -{ //out << __func__ << endl; +{ pdmA->GetProperty()->SetColor(r,g,b); } //------------------------------------------------------------------------------ @@ -275,7 +275,7 @@ void vvSlicer::SetCursorColor(int r,int g, int b) //------------------------------------------------------------------------------ void vvSlicer::SetCursorVisibility(bool s) -{ //out << __func__ << endl; +{ pdmA->SetVisibility(s); } //------------------------------------------------------------------------------ @@ -283,7 +283,7 @@ void vvSlicer::SetCursorVisibility(bool s) //------------------------------------------------------------------------------ bool vvSlicer::GetCursorVisibility() -{ //out << __func__ << endl; +{ return pdmA->GetVisibility(); } //------------------------------------------------------------------------------ @@ -291,7 +291,7 @@ bool vvSlicer::GetCursorVisibility() //------------------------------------------------------------------------------ void vvSlicer::SetCornerAnnotationVisibility(bool s) -{ //out << __func__ << endl; +{ ca->SetVisibility(s); } //------------------------------------------------------------------------------ @@ -299,7 +299,7 @@ void vvSlicer::SetCornerAnnotationVisibility(bool s) //------------------------------------------------------------------------------ bool vvSlicer::GetCornerAnnotationVisibility() -{ //out << __func__ << endl; +{ return ca->GetVisibility(); } //------------------------------------------------------------------------------ @@ -307,7 +307,7 @@ bool vvSlicer::GetCornerAnnotationVisibility() //------------------------------------------------------------------------------ vvSlicer::~vvSlicer() -{ //out << __func__ << endl; +{ for (std::vector::iterator i=mSurfaceCutActors.begin(); i!=mSurfaceCutActors.end(); i++) delete (*i); @@ -318,14 +318,14 @@ vvSlicer::~vvSlicer() //------------------------------------------------------------------------------ double* vvSlicer::GetCurrentPosition() -{ //out << __func__ << endl; +{ return mCurrentBeforeSlicingTransform; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvSlicer::SetCurrentPosition(double x, double y, double z, int t) -{ //out << __func__ << endl; +{ mCurrentBeforeSlicingTransform[0]=x; mCurrentBeforeSlicingTransform[1]=y; mCurrentBeforeSlicingTransform[2]=z; @@ -337,7 +337,7 @@ void vvSlicer::SetCurrentPosition(double x, double y, double z, int t) //------------------------------------------------------------------------------ void vvSlicer::SetImage(vvImage::Pointer image) -{ //out << __func__ << endl; +{ if (image->GetVTKImages().size()) { mImage = image; @@ -401,7 +401,7 @@ void vvSlicer::SetImage(vvImage::Pointer image) //------------------------------------------------------------------------------ void vvSlicer::SetOverlay(vvImage::Pointer overlay) -{ //out << __func__ << endl; +{ if (overlay->GetVTKImages().size()) { mOverlay = overlay; mOverlayVisibility = true; @@ -466,7 +466,7 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay) //------------------------------------------------------------------------------ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode) -{ //out << __func__ << endl; +{ mFusionSequenceCode = fusionSequenceCode; if (fusion->GetVTKImages().size()) { mFusion = fusion; @@ -533,7 +533,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode) //------------------------------------------------------------------------------ bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_index) -{ //out << __func__ << endl; +{ bool vis = false; if (actor_type == "image") vis = mImageVisibility; @@ -551,7 +551,7 @@ bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_ind //------------------------------------------------------------------------------ void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis) -{ //out << __func__ << endl; +{ if (actor_type == "image") mImageVisibility = vis; else if (actor_type == "vector") @@ -568,7 +568,7 @@ void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_ind //------------------------------------------------------------------------------ void vvSlicer::SetVF(vvImage::Pointer vf) -{ //out << __func__ << endl; +{ if (vf->GetVTKImages().size()) { mVF = vf; mVFVisibility = true; @@ -646,7 +646,7 @@ void vvSlicer::SetVF(vvImage::Pointer vf) //------------------------------------------------------------------------------ void vvSlicer::SetLandmarks(vvLandmarks* landmarks) -{ //out << __func__ << endl; +{ mLandmarks = landmarks; if (landmarks) { @@ -707,7 +707,7 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks) //------------------------------------------------------------------------------ //FIXME: this function leaks memory, we should fix it someday :) void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index) -{ //out << __func__ << endl; +{ if (actor_type == "vector") { Renderer->RemoveActor(mVFActor); mGlyphFilter=NULL; @@ -740,7 +740,7 @@ void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index) //------------------------------------------------------------------------------ void vvSlicer::SetVFSubSampling(int sub) -{ //out << __func__ << endl; +{ if (mVOIFilter) { mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling); mSubSampling = sub; @@ -753,7 +753,7 @@ void vvSlicer::SetVFSubSampling(int sub) //------------------------------------------------------------------------------ void vvSlicer::SetVFScale(int scale) -{ //out << __func__ << endl; +{ mScale = scale; if (mArrow) mArrow->SetScale(mScale); @@ -764,7 +764,7 @@ void vvSlicer::SetVFScale(int scale) //------------------------------------------------------------------------------ void vvSlicer::SetVFWidth(int width) -{ //out << __func__ << endl; +{ mVFWidth = width; if (mVFActor) mVFActor->GetProperty()->SetLineWidth(mVFWidth); @@ -776,7 +776,7 @@ void vvSlicer::SetVFWidth(int width) //------------------------------------------------------------------------------ void vvSlicer::SetVFLog(int log) -{ //out << __func__ << endl; +{ mVFLog = log; if (mGlyphFilter) { mGlyphFilter->SetUseLog(mVFLog); @@ -790,7 +790,7 @@ void vvSlicer::SetVFLog(int log) //------------------------------------------------------------------------------ void vvSlicer::SetTSlice(int t, bool updateLinkedImages) -{ //out << __func__ << endl; +{ if (!updateLinkedImages) { mCurrentTSlice = t; #if VTK_MAJOR_VERSION <= 5 @@ -873,7 +873,7 @@ void vvSlicer::SetTSlice(int t, bool updateLinkedImages) //------------------------------------------------------------------------------ void vvSlicer::SetFusionSequenceTSlice(int t) -{ //out << __func__ << endl; +{ if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode>=0)) { if (mFusion->GetVTKImages().size() > (unsigned int)t) { mCurrentFusionTSlice = t; @@ -896,14 +896,14 @@ void vvSlicer::SetFusionSequenceTSlice(int t) //------------------------------------------------------------------------------ int vvSlicer::GetTSlice() -{ //out << __func__ << endl; +{ return mCurrentTSlice; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ int vvSlicer::GetMaxCurrentTSlice() -{ //out << __func__ << endl; +{ int t = mCurrentTSlice; if(mOverlay) t = std::max(t, mCurrentOverlayTSlice); @@ -915,21 +915,21 @@ int vvSlicer::GetMaxCurrentTSlice() //------------------------------------------------------------------------------ int vvSlicer::GetFusionTSlice() -{ //out << __func__ << endl; +{ return mCurrentFusionTSlice; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ int vvSlicer::GetOverlayTSlice() -{ //out << __func__ << endl; +{ return mCurrentOverlayTSlice; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvSlicer::SetSliceOrientation(int orientation) -{ //out << __func__ << endl; +{ //if 2D image, force to watch in Axial View int extent[6]; #if VTK_MAJOR_VERSION <= 5 @@ -1001,7 +1001,7 @@ void vvSlicer::SetSliceOrientation(int orientation) // In other words, we change the grid of the reslice in the same way as the grid // of the displayed image in the slicing direction. void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice) -{ //out << __func__ << endl; +{ // Reset autocrop and update output information reslice->SetOutputOriginToDefault(); reslice->SetOutputSpacingToDefault(); @@ -1044,7 +1044,7 @@ void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice) //---------------------------------------------------------------------------- int * vvSlicer::GetExtent() -{ //out << __func__ << endl; +{ int *w_ext; if (mUseReducedExtent) { w_ext = mReducedExtent; @@ -1063,7 +1063,7 @@ int * vvSlicer::GetExtent() //---------------------------------------------------------------------------- int vvSlicer::GetOrientation() -{ //out << __func__ << endl; +{ return this->SliceOrientation; } //---------------------------------------------------------------------------- @@ -1071,7 +1071,7 @@ int vvSlicer::GetOrientation() //---------------------------------------------------------------------------- void vvSlicer::UpdateDisplayExtent() -{ //out << __func__ << endl; +{ vtkImageData *input = this->GetInput(); if (!input || !this->ImageActor) { @@ -1252,7 +1252,7 @@ void vvSlicer::UpdateDisplayExtent() //---------------------------------------------------------------------------- void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const int sourceExtent[6], vtkImageData *targetImage, int targetExtent[6]) -{ //out << __func__ << endl; +{ double dExtents[6]; for(unsigned int i=0; i<6; i++) { // From source voxel coordinates to world coordinates @@ -1274,7 +1274,7 @@ void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const //---------------------------------------------------------------------------- bool vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6]) -{ //out << __func__ << endl; +{ bool out = false; int maxBound = 6; @@ -1302,7 +1302,7 @@ bool vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6]) //---------------------------------------------------------------------------- void vvSlicer::UpdateOrientation() -{ //out << __func__ << endl; +{ // Set the camera position vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL; if (cam) { @@ -1332,7 +1332,7 @@ void vvSlicer::UpdateOrientation() //---------------------------------------------------------------------------- void vvSlicer::SetOpacity(double s) -{ //out << __func__ << endl; +{ this->GetImageActor()->SetOpacity(s); } //---------------------------------------------------------------------------- @@ -1340,7 +1340,7 @@ void vvSlicer::SetOpacity(double s) //---------------------------------------------------------------------------- void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw) -{ //out << __func__ << endl; +{ this->Superclass::SetRenderWindow(rw); this->SetupInteractor(rw->GetInteractor()); ca->SetImageActor(this->GetImageActor()); @@ -1372,7 +1372,7 @@ void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw) //---------------------------------------------------------------------------- void vvSlicer::ResetCamera() -{ //out << __func__ << endl; +{ this->GetRenderer()->ResetCamera(); } //---------------------------------------------------------------------------- @@ -1380,7 +1380,7 @@ void vvSlicer::ResetCamera() //---------------------------------------------------------------------------- void vvSlicer::SetDisplayMode(bool i) -{ //out << __func__ << endl; +{ this->GetRenderer()->SetDraw(i); if (i) UpdateDisplayExtent(); } @@ -1389,7 +1389,7 @@ void vvSlicer::SetDisplayMode(bool i) //---------------------------------------------------------------------------- void vvSlicer::FlipHorizontalView() -{ //out << __func__ << endl; +{ vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL; if (cam) { double *position = cam->GetPosition(); @@ -1420,7 +1420,7 @@ void vvSlicer::FlipHorizontalView() //---------------------------------------------------------------------------- void vvSlicer::FlipVerticalView() -{ //out << __func__ << endl; +{ vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL; if (cam) { FlipHorizontalView(); @@ -1434,7 +1434,7 @@ void vvSlicer::FlipVerticalView() //---------------------------------------------------------------------------- void vvSlicer::SetColorWindow(double window) -{ //out << __func__ << endl; +{ vtkLookupTable* LUT = static_cast(this->GetWindowLevel()->GetLookupTable()); if ( LUT ) { double level = this->GetWindowLevel()->GetLevel(); @@ -1447,7 +1447,7 @@ void vvSlicer::SetColorWindow(double window) //---------------------------------------------------------------------------- void vvSlicer::SetColorLevel(double level) -{ //out << __func__ << endl; +{ vtkLookupTable* LUT = static_cast(this->GetWindowLevel()->GetLookupTable()); if ( LUT ) { double window = this->GetWindowLevel()->GetWindow(); @@ -1460,7 +1460,7 @@ void vvSlicer::SetColorLevel(double level) //---------------------------------------------------------------------------- double vvSlicer::GetOverlayColorWindow() -{ //out << __func__ << endl; +{ if(mOverlayMapper) return mOverlayMapper->GetWindow(); else @@ -1470,7 +1470,7 @@ double vvSlicer::GetOverlayColorWindow() //---------------------------------------------------------------------------- double vvSlicer::GetOverlayColorLevel() -{ //out << __func__ << endl; +{ if(mOverlayMapper) return mOverlayMapper->GetLevel(); else @@ -1480,7 +1480,7 @@ double vvSlicer::GetOverlayColorLevel() //---------------------------------------------------------------------------- void vvSlicer::SetOverlayColorWindow(double window) -{ //out << __func__ << endl; +{ if(mOverlayMapper) mOverlayMapper->SetWindow(window); } @@ -1488,7 +1488,7 @@ void vvSlicer::SetOverlayColorWindow(double window) //---------------------------------------------------------------------------- void vvSlicer::SetOverlayColorLevel(double level) -{ //out << __func__ << endl; +{ if(mOverlayMapper) mOverlayMapper->SetLevel(level); } @@ -1497,7 +1497,7 @@ void vvSlicer::SetOverlayColorLevel(double level) //---------------------------------------------------------------------------- // Returns the min an the max value in a 20%x20% region around the mouse pointer void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image, vtkTransform *transform) -{ //out << __func__ << endl; +{ //Get mouse pointer position in view coordinates double corner1[3]; double corner2[3]; @@ -1563,7 +1563,7 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag //---------------------------------------------------------------------------- double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int &ix, int &iy, int &iz, int component) -{ //out << __func__ << endl; +{ ix = lrint(X); iy = lrint(Y); iz = lrint(Z); @@ -1595,7 +1595,7 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl //---------------------------------------------------------------------------- void vvSlicer::Render() -{ //out << __func__ << endl; +{ if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) { legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable()); @@ -1760,7 +1760,7 @@ void vvSlicer::Render() //---------------------------------------------------------------------------- void vvSlicer::UpdateCursorPosition() -{ //out << __func__ << endl; +{ pdmA->SetVisibility(true); mCursor[0] = mCurrent[0]; mCursor[1] = mCurrent[1]; @@ -1772,7 +1772,7 @@ void vvSlicer::UpdateCursorPosition() //---------------------------------------------------------------------------- void vvSlicer::UpdateLandmarks() -{ //out << __func__ << endl; +{ vtkPolyData *pd = static_cast(mLandClipper->GetInput()); if (pd->GetPoints()) { //mLandGlyph->SetRange(0,1); @@ -1815,7 +1815,7 @@ void vvSlicer::UpdateLandmarks() //---------------------------------------------------------------------------- void vvSlicer::SetSlice(int slice) -{ //out << __func__ << endl; +{ int *range = this->GetSliceRange(); if (range) { if (slice < range[0]) { @@ -1841,7 +1841,7 @@ void vvSlicer::SetSlice(int slice) //---------------------------------------------------------------------------- int vvSlicer::GetTMax() -{ //out << __func__ << endl; +{ int tmax = (int)mImage->GetVTKImages().size() - 1; if(mOverlay) tmax = std::max(tmax, (int)mOverlay->GetVTKImages().size()-1); @@ -1851,7 +1851,7 @@ int vvSlicer::GetTMax() //---------------------------------------------------------------------------- void vvSlicer::SetContourSlice() -{ //out << __func__ << endl; +{ if (mSurfaceCutActors.size() > 0) for (std::vector::iterator i=mSurfaceCutActors.begin(); i!=mSurfaceCutActors.end(); i++) { @@ -1866,7 +1866,7 @@ void vvSlicer::SetContourSlice() //---------------------------------------------------------------------------- void vvSlicer::ForceUpdateDisplayExtent() -{ //out << __func__ << endl; +{ this->UpdateDisplayExtent(); } //---------------------------------------------------------------------------- @@ -1874,7 +1874,7 @@ void vvSlicer::ForceUpdateDisplayExtent() //---------------------------------------------------------------------------- int* vvSlicer::GetDisplayExtent() -{ //out << __func__ << endl; +{ return this->GetImageActor()->GetDisplayExtent(); } //---------------------------------------------------------------------------- @@ -1882,7 +1882,7 @@ int* vvSlicer::GetDisplayExtent() //---------------------------------------------------------------------------- void vvSlicer::PrintSelf(ostream& os, vtkIndent indent) -{ //out << __func__ << endl; +{ this->Superclass::PrintSelf(os, indent); } //---------------------------------------------------------------------------- @@ -1890,7 +1890,7 @@ void vvSlicer::PrintSelf(ostream& os, vtkIndent indent) //---------------------------------------------------------------------------- void vvSlicer::SetVFColor(double r, double g, double b) -{ //out << __func__ << endl; +{ double mVFColorHSV[3]; mVFColor[0] = r; mVFColor[1] = g; @@ -1908,7 +1908,7 @@ void vvSlicer::SetVFColor(double r, double g, double b) //---------------------------------------------------------------------------- void vvSlicer::SetRegisterExtent(int ext[6]) -{ //out << __func__ << endl; +{ copyExtent(ext, mRegisterExtent); } //---------------------------------------------------------------------------- @@ -1916,7 +1916,7 @@ void vvSlicer::SetRegisterExtent(int ext[6]) //---------------------------------------------------------------------------- void vvSlicer::GetRegisterExtent(int ext[6]) -{ //out << __func__ << endl; +{ copyExtent(mRegisterExtent, ext); } //---------------------------------------------------------------------------- diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index cc99762..17995ac 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -46,7 +46,7 @@ #include //---------------------------------------------------------------------------- vvSlicerManager::vvSlicerManager(int numberOfSlicers) -{ //out << __func__ << endl; +{ mFileName = ""; mId = ""; mVFName = ""; @@ -91,7 +91,7 @@ vvSlicerManager::vvSlicerManager(int numberOfSlicers) //---------------------------------------------------------------------------- vvSlicerManager::~vvSlicerManager() -{ //out << __func__ << endl; +{ if (mLandmarks) delete mLandmarks; } @@ -100,7 +100,7 @@ vvSlicerManager::~vvSlicerManager() //------------------------------------------------------------------------------ void vvSlicerManager::SetFilename(std::string filename, int number) -{ //out << __func__ << endl; +{ mFileName = filename; mFileName = vtksys::SystemTools::GetFilenameName(mFileName); mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName)); @@ -122,7 +122,7 @@ void vvSlicerManager::SetFilename(std::string filename, int number) //---------------------------------------------------------------------------- void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->AddContour(contour,propagate); } @@ -132,7 +132,7 @@ void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate) //---------------------------------------------------------------------------- void vvSlicerManager::ToggleContourSuperposition() -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) mSlicers[i]->ToggleContourSuperposition(); } @@ -140,7 +140,7 @@ void vvSlicerManager::ToggleContourSuperposition() //---------------------------------------------------------------------------- std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType) -{ //out << __func__ << endl; +{ vvImageReader *reader = NULL; if(actorType=="image") @@ -171,7 +171,7 @@ std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::str //---------------------------------------------------------------------------- bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice) -{ //out << __func__ << endl; +{ mType = type; if (mReader.IsNull()) mReader = vvImageReader::New(); @@ -206,7 +206,7 @@ bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageT //---------------------------------------------------------------------------- void vvSlicerManager::SetImage(vvImage::Pointer image) -{ //out << __func__ << endl; +{ mImage=image; for (unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetImage(image); @@ -217,7 +217,7 @@ void vvSlicerManager::SetImage(vvImage::Pointer image) //---------------------------------------------------------------------------- bool vvSlicerManager::SetImages(std::vector filenames, vvImageReader::LoadedImageType type, int n) -{ //out << __func__ << endl; +{ mType = type; std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]); if (type == vvImageReader::DICOM) @@ -257,7 +257,7 @@ bool vvSlicerManager::SetImages(std::vector filenames, vvImageReade //---------------------------------------------------------------------------- bool vvSlicerManager::SetOverlay(std::vector filenames,int dim, std::string component, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ mOverlayName = filenames[0]; mOverlayComponent = component; if (dim > mImage->GetNumberOfDimensions()) { @@ -283,7 +283,7 @@ bool vvSlicerManager::SetOverlay(std::vector filenames,int dim, std //---------------------------------------------------------------------------- bool vvSlicerManager::SetFusion(std::vector filenames,int dim, std::string component, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ mFusionName = filenames[0]; mFusionComponent = component; if (dim > mImage->GetNumberOfDimensions()) { @@ -313,7 +313,7 @@ bool vvSlicerManager::SetFusion(std::vector filenames,int dim, std: //---------------------------------------------------------------------------- //this function is called by vvMainWindow::AddFusionSequence for the primary sequence (CT), while the given files constitute the secondary sequence. bool vvSlicerManager::SetFusionSequence(std::vector filenames, int dim, std::string component, vvImageReader::LoadedImageType type) -{ //out << __func__ << endl; +{ mFusionSequenceInvolvementCode = 0; mFusionName = filenames[0]; @@ -362,7 +362,7 @@ bool vvSlicerManager::SetFusionSequence(std::vector filenames, int //---------------------------------------------------------------------------- bool vvSlicerManager::SetVF(std::string filename) -{ //out << __func__ << endl; +{ if (mVectorReader.IsNull()) mVectorReader = vvImageReader::New(); mVectorReader->SetInputFilename(filename); @@ -382,7 +382,7 @@ bool vvSlicerManager::SetVF(std::string filename) //---------------------------------------------------------------------------- bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename) -{ //out << __func__ << endl; +{ if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions()) { mLastError = "Sorry, vector field dimension cannot be greater then reference image."; return false; @@ -409,7 +409,7 @@ bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename) //---------------------------------------------------------------------------- vvSlicer* vvSlicerManager::GetSlicer(int i) -{ //out << __func__ << endl; +{ return mSlicers[i]; } //---------------------------------------------------------------------------- @@ -417,7 +417,7 @@ vvSlicer* vvSlicerManager::GetSlicer(int i) //---------------------------------------------------------------------------- void vvSlicerManager::UpdateSlicer(int num, bool state) -{ //out << __func__ << endl; +{ if (mSlicers[num]->GetImage()) { mSlicers[num]->SetDisplayMode(state); } @@ -427,7 +427,7 @@ void vvSlicerManager::UpdateSlicer(int num, bool state) //---------------------------------------------------------------------------- void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW) -{ //out << __func__ << endl; +{ mSlicers[i]->SetRenderWindow(i,RW); } //---------------------------------------------------------------------------- @@ -435,7 +435,7 @@ void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW) //---------------------------------------------------------------------------- void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* style) -{ //out << __func__ << endl; +{ vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New(); smc->SM = this; smc->SetSlicerNumber(i); @@ -474,7 +474,7 @@ void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* sty //---------------------------------------------------------------------------- void vvSlicerManager::LeftButtonReleaseEvent(int slicer) -{ //out << __func__ << endl; +{ emit LeftButtonReleaseSignal(slicer); } //---------------------------------------------------------------------------- @@ -482,7 +482,7 @@ void vvSlicerManager::LeftButtonReleaseEvent(int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::EmitMousePositionUpdated(int slicer) -{ //out << __func__ << endl; +{ emit MousePositionUpdatedSignal(slicer); } //---------------------------------------------------------------------------- @@ -490,7 +490,7 @@ void vvSlicerManager::EmitMousePositionUpdated(int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::EmitKeyPressed(std::string KeyPress) -{ //out << __func__ << endl; +{ emit KeyPressedSignal(KeyPress); } //---------------------------------------------------------------------------- @@ -498,7 +498,7 @@ void vvSlicerManager::EmitKeyPressed(std::string KeyPress) //---------------------------------------------------------------------------- void vvSlicerManager::SetSliceOrientation(int slicer, int orientation) -{ //out << __func__ << endl; +{ mSlicers[slicer]->SetSliceOrientation(orientation); emit UpdateOrientation(slicer, orientation); } @@ -506,14 +506,14 @@ void vvSlicerManager::SetSliceOrientation(int slicer, int orientation) //---------------------------------------------------------------------------- int vvSlicerManager::GetTSlice() -{ //out << __func__ << endl; +{ return mSlicers[0]->GetTSlice(); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void vvSlicerManager::SetTSlice(int slice, bool updateLinkedImages) -{ //out << __func__ << endl; +{ if (!updateLinkedImages) { //for fusionSequence, TMax / MaxCurrentTSlice are irrelevant. for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetTSlice(slice, updateLinkedImages); @@ -540,7 +540,7 @@ void vvSlicerManager::SetTSlice(int slice, bool updateLinkedImages) //---------------------------------------------------------------------------- void vvSlicerManager::SetFusionSequenceTSlice(int slice) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetFusionSequenceTSlice(slice); UpdateTSlice(i); @@ -551,7 +551,7 @@ void vvSlicerManager::SetFusionSequenceTSlice(int slice) //---------------------------------------------------------------------------- void vvSlicerManager::SetNextTSlice(int originating_slicer) -{ //out << __func__ << endl; +{ int t = mSlicers[0]->GetMaxCurrentTSlice(); t++; if (t > mSlicers[0]->GetTMax()) @@ -563,7 +563,7 @@ void vvSlicerManager::SetNextTSlice(int originating_slicer) //---------------------------------------------------------------------------- void vvSlicerManager::SetPreviousTSlice(int originating_slicer) -{ //out << __func__ << endl; +{ int t = mSlicers[0]->GetMaxCurrentTSlice(); t--; if (t < 0) @@ -575,7 +575,7 @@ void vvSlicerManager::SetPreviousTSlice(int originating_slicer) //---------------------------------------------------------------------------- void vvSlicerManager::ToggleInterpolation() -{ //out << __func__ << endl; +{ bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate()); for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->GetImageActor()->SetInterpolate(interpolate); @@ -590,7 +590,7 @@ void vvSlicerManager::ToggleInterpolation() //---------------------------------------------------------------------------- void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer) -{ //out << __func__ << endl; +{ if (tslice < 0) tslice = 0; else if (tslice > mSlicers[slicer]->GetTMax()) @@ -616,7 +616,7 @@ void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::SetColorWindow(double s) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetColorWindow(s); } @@ -625,7 +625,7 @@ void vvSlicerManager::SetColorWindow(double s) //---------------------------------------------------------------------------- void vvSlicerManager::SetColorLevel(double s) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetColorLevel(s); } @@ -634,7 +634,7 @@ void vvSlicerManager::SetColorLevel(double s) //---------------------------------------------------------------------------- void vvSlicerManager::SetOverlayColorWindow(double s) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetOverlayColorWindow(s); } @@ -643,7 +643,7 @@ void vvSlicerManager::SetOverlayColorWindow(double s) //---------------------------------------------------------------------------- void vvSlicerManager::SetOverlayColorLevel(double s) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetOverlayColorLevel(s); } @@ -652,7 +652,7 @@ void vvSlicerManager::SetOverlayColorLevel(double s) //---------------------------------------------------------------------------- void vvSlicerManager::SetLinkOverlayWindowLevel(bool b) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetLinkOverlayWindowLevel(b); } @@ -661,7 +661,7 @@ void vvSlicerManager::SetLinkOverlayWindowLevel(bool b) //---------------------------------------------------------------------------- void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s) -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetCursorVisibility(s); mSlicers[i]->SetCornerAnnotationVisibility(s); @@ -671,7 +671,7 @@ void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s) //---------------------------------------------------------------------------- void vvSlicerManager::SetOpacity(int i, double factor) -{ //out << __func__ << endl; +{ mSlicers[i]->SetOpacity(1/factor); } //---------------------------------------------------------------------------- @@ -679,7 +679,7 @@ void vvSlicerManager::SetOpacity(int i, double factor) //---------------------------------------------------------------------------- void vvSlicerManager::UpdateViews(int current,int slicer) -{ //out << __func__ << endl; +{ double p[3], pt[3]; p[0] = mSlicers[slicer]->GetCurrentPosition()[0]; p[1] = mSlicers[slicer]->GetCurrentPosition()[1]; @@ -835,7 +835,7 @@ mSlicers[slicer]->GetRegisterExtent(extentImageReslice); //---------------------------------------------------------------------------- void vvSlicerManager::UpdateLinked(int slicer) -{ //out << __func__ << endl; +{ double p[3], pt[3]; p[0] = mSlicers[slicer]->GetCurrentPosition()[0]; p[1] = mSlicers[slicer]->GetCurrentPosition()[1]; @@ -886,7 +886,7 @@ mSlicers[slicer]->GetRegisterExtent(extentImageReslice); //---------------------------------------------------------------------------- void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagate) -{ //out << __func__ << endl; +{ vtkCamera *refCam = refSlicer->GetRenderer()->GetActiveCamera(); double refPosition[3]; @@ -929,7 +929,7 @@ void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagat //---------------------------------------------------------------------------- double vvSlicerManager::GetColorWindow() const -{ //out << __func__ << endl; +{ if (mSlicers.size()) return mSlicers[0]->GetColorWindow(); return -1; @@ -939,7 +939,7 @@ double vvSlicerManager::GetColorWindow() const //---------------------------------------------------------------------------- double vvSlicerManager::GetColorLevel() const -{ //out << __func__ << endl; +{ if (mSlicers.size()) return mSlicers[0]->GetColorLevel(); return -1; @@ -948,7 +948,7 @@ double vvSlicerManager::GetColorLevel() const //---------------------------------------------------------------------------- double vvSlicerManager::GetOverlayColorWindow() const -{ //out << __func__ << endl; +{ if (mSlicers.size()) return mSlicers[0]->GetOverlayColorWindow(); return -1; @@ -957,7 +957,7 @@ double vvSlicerManager::GetOverlayColorWindow() const //---------------------------------------------------------------------------- double vvSlicerManager::GetOverlayColorLevel() const -{ //out << __func__ << endl; +{ if (mSlicers.size()) return mSlicers[0]->GetOverlayColorLevel(); return -1; @@ -966,7 +966,7 @@ double vvSlicerManager::GetOverlayColorLevel() const //---------------------------------------------------------------------------- bool vvSlicerManager::GetLinkOverlayWindowLevel() const -{ //out << __func__ << endl; +{ if (mSlicers.size()) return mSlicers[0]->GetLinkOverlayWindowLevel(); return -1; @@ -975,7 +975,7 @@ bool vvSlicerManager::GetLinkOverlayWindowLevel() const //------------------------------------------------------------------------------ void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType) -{ //out << __func__ << endl; +{ if(actorType == "image") for(unsigned int i=0; iGetImage()->GetTransform().size(); i++) this->GetImage()->GetTransform()[i]->Identity(); @@ -1004,7 +1004,7 @@ void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType) //---------------------------------------------------------------------------- void vvSlicerManager::Render() -{ //out << __func__ << endl; +{ for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->Render(); } @@ -1014,7 +1014,7 @@ void vvSlicerManager::Render() //---------------------------------------------------------------------------- void vvSlicerManager::GenerateDefaultLookupTable() -{ //out << __func__ << endl; +{ SetPreset(mPreset); SetColorMap(mColorMap); } @@ -1023,7 +1023,7 @@ void vvSlicerManager::GenerateDefaultLookupTable() //---------------------------------------------------------------------------- void vvSlicerManager::Reload() -{ //out << __func__ << endl; +{ mReader->Update(mType); mImage=mReader->GetOutput(); for ( unsigned int i = 0; i < mSlicers.size(); i++) { @@ -1040,7 +1040,7 @@ void vvSlicerManager::Reload() //---------------------------------------------------------------------------- void vvSlicerManager::ReloadFusion() -{ //out << __func__ << endl; +{ mFusionReader->Update(mImage->GetNumberOfDimensions(),mFusionComponent.c_str(),mType); for ( unsigned int i = 0; i < mSlicers.size(); i++) { @@ -1053,7 +1053,7 @@ void vvSlicerManager::ReloadFusion() //---------------------------------------------------------------------------- //the secondary sequence is being reloaded. void vvSlicerManager::ReloadFusionSequence() -{ //out << __func__ << endl; +{ // this is to keep the slice thickness, which needs to be artificially increased for visualization double sp_x, sp_y, sp_z; this->GetImage()->GetVTKImages()[0]->GetSpacing(sp_x, sp_y, sp_z); @@ -1090,7 +1090,7 @@ void vvSlicerManager::ReloadFusionSequence() //---------------------------------------------------------------------------- void vvSlicerManager::ReloadOverlay() -{ //out << __func__ << endl; +{ mOverlayReader->Update(mImage->GetNumberOfDimensions(),mOverlayComponent.c_str(),mType); for ( unsigned int i = 0; i < mSlicers.size(); i++) { mSlicers[i]->SetOverlay(mOverlayReader->GetOutput()); @@ -1102,7 +1102,7 @@ void vvSlicerManager::ReloadOverlay() //---------------------------------------------------------------------------- void vvSlicerManager::ReloadVF() -{ //out << __func__ << endl; +{ mVectorReader->Update(vvImageReader::VECTORFIELD); //deletes the old images through the VF::Init() function mVF=mVectorReader->GetOutput(); for ( unsigned int i = 0; i < mSlicers.size(); i++) { @@ -1115,7 +1115,7 @@ void vvSlicerManager::ReloadVF() //---------------------------------------------------------------------------- void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index) -{ //out << __func__ << endl; +{ if (actor_type =="overlay") mOverlayReader = NULL; @@ -1139,7 +1139,7 @@ void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_ind //---------------------------------------------------------------------------- void vvSlicerManager::RemoveActors() -{ //out << __func__ << endl; +{ ///This method leaks a few objects. See RemoveActor for what a ///correct implementation would look like //DS -> probably due to the reader (now released in the @@ -1154,7 +1154,7 @@ void vvSlicerManager::RemoveActors() //---------------------------------------------------------------------------- void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer) -{ //out << __func__ << endl; +{ // int view = mSlicers[slicer]->GetSliceOrientation(); // int slice = mSlicers[slicer]->GetSlice(); double x = mSlicers[slicer]->GetCursorPosition()[0]; @@ -1301,7 +1301,7 @@ mSlicers[slicer]->GetRegisterExtent(extentImageReslice); //---------------------------------------------------------------------------- void vvSlicerManager::Activated() -{ //out << __func__ << endl; +{ emit currentImageChanged(mId); } //---------------------------------------------------------------------------- @@ -1309,7 +1309,7 @@ void vvSlicerManager::Activated() //---------------------------------------------------------------------------- void vvSlicerManager::Picked() -{ //out << __func__ << endl; +{ emit currentPickedImageChanged(mId); } //---------------------------------------------------------------------------- @@ -1317,7 +1317,7 @@ void vvSlicerManager::Picked() //---------------------------------------------------------------------------- void vvSlicerManager::UpdateWindowLevel() -{ //out << __func__ << endl; +{ emit WindowLevelChanged(); } //---------------------------------------------------------------------------- @@ -1325,7 +1325,7 @@ void vvSlicerManager::UpdateWindowLevel() //---------------------------------------------------------------------------- void vvSlicerManager::UpdateSlice(int slicer) -{ //out << __func__ << endl; +{ if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) { //DD("============= NOTHING"); return; @@ -1339,7 +1339,7 @@ void vvSlicerManager::UpdateSlice(int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::UpdateTSlice(int slicer) -{ //out << __func__ << endl; +{ int slice = mSlicers[slicer]->GetSlice(); int tslice = mSlicers[slicer]->GetMaxCurrentTSlice(); @@ -1361,7 +1361,7 @@ void vvSlicerManager::UpdateTSlice(int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::UpdateSliceRange(int slicer) -{ //out << __func__ << endl; +{ emit UpdateSliceRange(slicer, mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1], 0,mSlicers[slicer]->GetTMax()); @@ -1370,7 +1370,7 @@ void vvSlicerManager::UpdateSliceRange(int slicer) //---------------------------------------------------------------------------- void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset) -{ //out << __func__ << endl; +{ if(mSlicingPreset==preset) return; @@ -1413,7 +1413,7 @@ void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset) //---------------------------------------------------------------------------- void vvSlicerManager::SetPreset(int preset) -{ //out << __func__ << endl; +{ //vtkLookupTable* LUT = static_cast(mSlicers[0]->GetWindowLevel()->GetLookupTable()); double window = mSlicers[0]->GetColorWindow(); @@ -1472,7 +1472,7 @@ void vvSlicerManager::SetPreset(int preset) //---------------------------------------------------------------------------- void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey) -{ //out << __func__ << endl; +{ double min, max; if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) { int t = mSlicers[slicer]->GetFusionTSlice(); @@ -1513,7 +1513,7 @@ void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlK //---------------------------------------------------------------------------- void vvSlicerManager::SetColorMap(int colormap) -{ //out << __func__ << endl; +{ double range[2]; range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0]; @@ -1667,7 +1667,7 @@ void vvSlicerManager::SetColorMap(int colormap) //---------------------------------------------------------------------------- vvLandmarks* vvSlicerManager::GetLandmarks() -{ //out << __func__ << endl; +{ if (mLandmarks == NULL) { mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1); for (unsigned int i = 0; i < mSlicers.size(); i++) @@ -1680,7 +1680,7 @@ vvLandmarks* vvSlicerManager::GetLandmarks() //---------------------------------------------------------------------------- void vvSlicerManager::AddLandmark(float x,float y,float z,float t) -{ //out << __func__ << endl; +{ double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0]; double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1]; double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2]; @@ -1714,21 +1714,21 @@ void vvSlicerManager::AddLandmark(float x,float y,float z,float t) //---------------------------------------------------------------------------- void vvSlicerManager::PrevImage(int slicer) -{ //out << __func__ << endl; +{ emit ChangeImageWithIndexOffset(this, slicer, -1); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void vvSlicerManager::NextImage(int slicer) -{ //out << __func__ << endl; +{ emit ChangeImageWithIndexOffset(this, slicer, 1); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice) -{ //out << __func__ << endl; +{ emit AVerticalSliderHasChanged(slicer, slice); } @@ -1736,7 +1736,7 @@ void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice) //---------------------------------------------------------------------------- double vvSlicerManager::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int component) -{ //out << __func__ << endl; +{ int ix, iy, iz; return mSlicers[0]->GetScalarComponentAsDouble(image, X, Y, Z, ix, iy, iz, component); } diff --git a/vv/vvToolBinarize.cxx b/vv/vvToolBinarize.cxx index 2e693d1..5fce5d9 100644 --- a/vv/vvToolBinarize.cxx +++ b/vv/vvToolBinarize.cxx @@ -41,7 +41,7 @@ ADD_TOOL(vvToolBinarize); //------------------------------------------------------------------------------ void vvToolBinarize::Initialize() -{ //out << __func__ << endl; +{ SetToolName("Binarize"); SetToolMenuName("Binarize"); SetToolIconFilename(":/common/icons/binarize.png"); @@ -55,7 +55,7 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f) :vvToolWidgetBase(parent,f), vvToolBase(parent), Ui::vvToolBinarize() -{ //out << __func__ << endl; +{ // GUI Initialization Ui_vvToolBinarize::setupUi(mToolWidget); mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked(); @@ -83,14 +83,14 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f) //------------------------------------------------------------------------------ vvToolBinarize::~vvToolBinarize() -{ //out << __func__ << endl; +{ } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::InteractiveDisplayToggled(bool b) -{ //out << __func__ << endl; +{ mInteractiveDisplayIsEnabled = b; if (!mInteractiveDisplayIsEnabled) { RemoveVTKObjects(); @@ -109,7 +109,7 @@ void vvToolBinarize::InteractiveDisplayToggled(bool b) //------------------------------------------------------------------------------ void vvToolBinarize::RemoveVTKObjects() -{ //out << __func__ << endl; +{ for(unsigned int i=0; iHideActors(); mImageContourLower[i]->HideActors(); @@ -122,7 +122,7 @@ void vvToolBinarize::RemoveVTKObjects() //------------------------------------------------------------------------------ bool vvToolBinarize::close() -{ //out << __func__ << endl; +{ // RemoveVTKObjects(); return vvToolWidgetBase::close(); } @@ -131,7 +131,7 @@ bool vvToolBinarize::close() //------------------------------------------------------------------------------ void vvToolBinarize::closeEvent(QCloseEvent *event) -{ //out << __func__ << endl; +{ RemoveVTKObjects(); event->accept(); } @@ -140,7 +140,7 @@ void vvToolBinarize::closeEvent(QCloseEvent *event) //------------------------------------------------------------------------------ void vvToolBinarize::reject() -{ //out << __func__ << endl; +{ // DD("vvToolBinarize::reject"); RemoveVTKObjects(); return vvToolWidgetBase::reject(); @@ -150,7 +150,7 @@ void vvToolBinarize::reject() //------------------------------------------------------------------------------ void vvToolBinarize::enableLowerThan(bool b) -{ //out << __func__ << endl; +{ if (!b) { mThresholdSlider1->resetMaximum(); for(unsigned int i=0; iisChecked() && !mCheckBoxUseFG->isChecked()) mCheckBoxUseBG->toggle(); } @@ -184,7 +184,7 @@ void vvToolBinarize::useFGBGtoggled(bool) // DD(m.size()); // } void vvToolBinarize::InputIsSelected(vvSlicerManager * m) -{ //out << __func__ << endl; +{ mCurrentSlicerManager = m; // Specific for this gui @@ -251,21 +251,21 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolBinarize::UpdateOrientation(int slicer,int orientation) -{ //out << __func__ << endl; +{ Update(slicer); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::UpdateSlice(int slicer,int slices) -{ //out << __func__ << endl; +{ Update(slicer); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::Update(int slicer) -{ //out << __func__ << endl; +{ if (!mInteractiveDisplayIsEnabled) return; if (!mCurrentSlicerManager) close(); mImageContour[slicer]->Update(mThresholdSlider1->GetValue()); @@ -276,7 +276,7 @@ void vvToolBinarize::Update(int slicer) //------------------------------------------------------------------------------ void vvToolBinarize::GetArgsInfoFromGUI() -{ //out << __func__ << endl; +{ /* //KEEP THIS FOR READING GGO FROM FILE int argc=1; @@ -331,7 +331,7 @@ void vvToolBinarize::GetArgsInfoFromGUI() //------------------------------------------------------------------------------ void vvToolBinarize::apply() -{ //out << __func__ << endl; +{ if (!mCurrentSlicerManager) close(); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); GetArgsInfoFromGUI(); @@ -357,7 +357,7 @@ void vvToolBinarize::apply() //------------------------------------------------------------------------------ void vvToolBinarize::valueChangedT2(double v) -{ //out << __func__ << endl; +{ // DD("valueChangedT2"); if (mRadioButtonLowerThan->isChecked()) { mThresholdSlider1->SetMaximum(v); @@ -373,7 +373,7 @@ void vvToolBinarize::valueChangedT2(double v) //------------------------------------------------------------------------------ void vvToolBinarize::valueChangedT1(double v) -{ //out << __func__ << endl; +{ // DD("valueChangedT1"); if (!mCurrentSlicerManager) close(); mThresholdSlider2->SetMinimum(v); diff --git a/vv/vvToolROIManager.cxx b/vv/vvToolROIManager.cxx index ef83846..d5d66ef 100644 --- a/vv/vvToolROIManager.cxx +++ b/vv/vvToolROIManager.cxx @@ -53,7 +53,7 @@ vvToolROIManager::vvToolROIManager(vvMainWindowBase * parent, Qt::WindowFlags f) QWidget(parent->GetTab()), vvToolBase(parent), Ui::vvToolROIManager() -{ //out << __func__ << endl; +{ // Store parent mMainWindow = parent; @@ -93,7 +93,7 @@ vvToolROIManager::vvToolROIManager(vvMainWindowBase * parent, Qt::WindowFlags f) //------------------------------------------------------------------------------ vvToolROIManager::~vvToolROIManager() -{ //out << __func__ << endl; +{ mROIActorsList.clear(); } //------------------------------------------------------------------------------ @@ -102,7 +102,7 @@ vvToolROIManager::~vvToolROIManager() //------------------------------------------------------------------------------ // STATIC void vvToolROIManager::Initialize() -{ //out << __func__ << endl; +{ SetToolName("ROIManager"); SetToolMenuName("Open ROI (binary image or RT-STRUCT)"); SetToolIconFilename(":/common/icons/tool-roi.png"); @@ -115,7 +115,7 @@ void vvToolROIManager::Initialize() //------------------------------------------------------------------------------ void vvToolROIManager::InitializeNewTool(bool ReadStateFlag) -{ //out << __func__ << endl; +{ // Check if we need to start a new tool or read in the state file to load if (ReadStateFlag == false) { // Select the current image as the target @@ -221,7 +221,7 @@ void vvToolROIManager::InitializeNewTool(bool ReadStateFlag) //------------------------------------------------------------------------------ void vvToolROIManager::InputIsSelected(vvSlicerManager *m) -{ //out << __func__ << endl; +{ // Initialization mCurrentSlicerManager = m; mCurrentImage = mCurrentSlicerManager->GetImage(); @@ -244,7 +244,7 @@ void vvToolROIManager::InputIsSelected(vvSlicerManager *m) //------------------------------------------------------------------------------ void vvToolROIManager::AnImageIsBeingClosed(vvSlicerManager * m) -{ //out << __func__ << endl; +{ if (m == mCurrentSlicerManager) { close(); return; @@ -255,7 +255,7 @@ void vvToolROIManager::AnImageIsBeingClosed(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolROIManager::close() -{ //out << __func__ << endl; +{ disconnect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree())); disconnect(mCheckBoxShow, SIGNAL(toggled(bool)), this, SLOT(VisibleROIToggled(bool))); disconnect(mOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OpacityChanged(int))); @@ -281,7 +281,7 @@ void vvToolROIManager::close() //------------------------------------------------------------------------------ void vvToolROIManager::SelectedImageHasChanged(vvSlicerManager * m) -{ //out << __func__ << endl; +{ if (mCurrentSlicerManager == NULL) return; if (m == NULL) return; if (m != mCurrentSlicerManager) hide(); @@ -294,7 +294,7 @@ void vvToolROIManager::SelectedImageHasChanged(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolROIManager::Open() -{ //out << __func__ << endl; +{ // Open images QString Extensions = "Images or Dicom-Struct files ( *.mha *.mhd *.hdr *.his *.dcm RS*)"; Extensions += ";;All Files (*)"; @@ -315,7 +315,7 @@ void vvToolROIManager::Open() //------------------------------------------------------------------------------ void vvToolROIManager::OpenBinaryImage(QStringList & filename) -{ //out << __func__ << endl; +{ if (filename.size() == 0) return; vvProgressDialog p("Reading ROI ...", true); @@ -359,7 +359,7 @@ void vvToolROIManager::OpenBinaryImage(QStringList & filename) //------------------------------------------------------------------------------ void vvToolROIManager::OpenDicomImage(std::string filename) -{ //out << __func__ << endl; +{ // GUI selector of roi vvMeshReader reader; reader.SetFilename(filename); @@ -411,7 +411,7 @@ void vvToolROIManager::AddImage(vvImage * binaryImage, std::string name, std::string filename, double BG, bool modeBG) -{ //out << __func__ << endl; +{ // Check Dimension int dim = mCurrentImage->GetNumberOfDimensions(); int bin_dim = binaryImage->GetNumberOfDimensions(); @@ -493,7 +493,7 @@ void vvToolROIManager::AddImage(vvImage * binaryImage, //------------------------------------------------------------------------------ void vvToolROIManager::UpdateAllContours() -{ //out << __func__ << endl; +{ if (mCurrentSlicerManager == NULL) return; // Render loaded ROIs (the first is sufficient) for(unsigned int i=0; i l = mTree->selectedItems(); if (l.size() == 0) { @@ -614,7 +614,7 @@ void vvToolROIManager::SelectedItemChangedInTree() //------------------------------------------------------------------------------ void vvToolROIManager::VisibleROIToggled(bool b) -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; if (b == mCurrentROIActor->IsVisible()) return; // nothing to do mCurrentROIActor->SetVisible(b); @@ -626,7 +626,7 @@ void vvToolROIManager::VisibleROIToggled(bool b) //------------------------------------------------------------------------------ void vvToolROIManager::VisibleContourROIToggled(bool b) -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; if (mCurrentROIActor->IsContourVisible() == b) return; // nothing to do mCurrentROIActor->SetContourVisible(b); @@ -638,7 +638,7 @@ void vvToolROIManager::VisibleContourROIToggled(bool b) //------------------------------------------------------------------------------ void vvToolROIManager::OpacityChanged(int v) -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; mCurrentROIActor->SetOpacity((double)v/100.0); mCurrentROIActor->UpdateColor(); @@ -649,7 +649,7 @@ void vvToolROIManager::OpacityChanged(int v) //------------------------------------------------------------------------------ void vvToolROIManager::AllVisibleROIToggled(int b) -{ //out << __func__ << endl; +{ bool status = false; if ((mCheckBoxShowAll->checkState() == Qt::Checked) || (mCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true; @@ -667,7 +667,7 @@ void vvToolROIManager::AllVisibleROIToggled(int b) //------------------------------------------------------------------------------ void vvToolROIManager::AllVisibleContourROIToggled(bool b) -{ //out << __func__ << endl; +{ bool status = false; if ((mContourCheckBoxShowAll->checkState() == Qt::Checked) || (mContourCheckBoxShowAll->checkState() == Qt::PartiallyChecked)) status = true; @@ -686,7 +686,7 @@ void vvToolROIManager::AllVisibleContourROIToggled(bool b) //------------------------------------------------------------------------------ void vvToolROIManager::ChangeColor() -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; QColor color; color.setRgbF(mCurrentROIActor->GetROI()->GetDisplayColor()[0], @@ -712,7 +712,7 @@ void vvToolROIManager::ChangeColor() //------------------------------------------------------------------------------ void vvToolROIManager::ChangeContourColor() -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; QColor color; color.setRgbF(mCurrentROIActor->GetContourColor()[0], @@ -730,7 +730,7 @@ void vvToolROIManager::ChangeContourColor() //------------------------------------------------------------------------------ void vvToolROIManager::ChangeContourWidth(int n) -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; mCurrentROIActor->SetContourWidth(n); mCurrentROIActor->UpdateColor(); @@ -741,7 +741,7 @@ void vvToolROIManager::ChangeContourWidth(int n) //------------------------------------------------------------------------------ void vvToolROIManager::ChangeDepth(int n) -{ //out << __func__ << endl; +{ if (mCurrentROIActor == NULL) return; mCurrentROIActor->SetDepth(n); // mCurrentROIActor->UpdateImage(); // FIXME @@ -755,7 +755,7 @@ void vvToolROIManager::ChangeDepth(int n) //------------------------------------------------------------------------------ void vvToolROIManager::ReloadCurrentROI() -{ //out << __func__ << endl; +{ if (mCurrentROI->GetFilename() == "") { return; // do nothing (contour from rt struct do not reload) } @@ -796,7 +796,7 @@ void vvToolROIManager::ReloadCurrentROI() //------------------------------------------------------------------------------ void vvToolROIManager::SaveState(std::auto_ptr & m_XmlWriter) -{ //out << __func__ << endl; +{ // Get index of the image int n = mMainWindow->GetSlicerManagers().size(); int index=-1; @@ -842,7 +842,7 @@ void vvToolROIManager::SaveState(std::auto_ptr & m_XmlWriter) //------------------------------------------------------------------------------ void vvToolROIManager::ReadXMLInformation() -{ //out << __func__ << endl; +{ std::string value=""; mInitialImageIndex = -1; while (!(m_XmlReader->isEndElement() && value == GetToolName().toStdString())) { @@ -864,7 +864,7 @@ void vvToolROIManager::ReadXMLInformation() //------------------------------------------------------------------------------ void vvToolROIManager::ReadXMLInformation_ROI() -{ //out << __func__ << endl; +{ QString s; std::string value=""; QSharedPointer param = QSharedPointer(new vvROIActor); diff --git a/vv/vvToolWidgetBase.cxx b/vv/vvToolWidgetBase.cxx index 6d89fcf..9c85336 100644 --- a/vv/vvToolWidgetBase.cxx +++ b/vv/vvToolWidgetBase.cxx @@ -38,7 +38,7 @@ bool vvToolWidgetBase::mIsAnotherToolWaitInput = false; vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f, bool initialize): QWidget(parent, f), Ui::vvToolWidgetBase() -{ //out << __func__ << endl; +{ mMainWindow = parent; setAttribute(Qt::WA_DeleteOnClose); if (initialize) Initialization(); @@ -116,7 +116,7 @@ vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f, //------------------------------------------------------------------------------ void vvToolWidgetBase::Initialization() -{ //out << __func__ << endl; +{ mCurrentSlicerManager = 0; mIsInitialized = false; mFilter = 0; @@ -139,14 +139,14 @@ void vvToolWidgetBase::Initialization() //------------------------------------------------------------------------------ vvToolWidgetBase::~vvToolWidgetBase() -{ //out << __func__ << endl; +{ } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolWidgetBase::keyPressEvent(QKeyEvent *event) -{ //out << __func__ << endl; +{ if (event->key() == Qt::Key_Escape) { reject(); event->accept(); @@ -164,7 +164,7 @@ void vvToolWidgetBase::keyPressEvent(QKeyEvent *event) //------------------------------------------------------------------------------ void vvToolWidgetBase::accept() -{ //out << __func__ << endl; +{ apply(); } //------------------------------------------------------------------------------ @@ -172,7 +172,7 @@ void vvToolWidgetBase::accept() //------------------------------------------------------------------------------ void vvToolWidgetBase::reject() -{ //out << __func__ << endl; +{ close(); } //------------------------------------------------------------------------------ @@ -180,7 +180,7 @@ void vvToolWidgetBase::reject() //------------------------------------------------------------------------------ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFilterBase * f, bool allowSkip) -{ //out << __func__ << endl; +{ int j=0; mFilter = f; mSlicerManagersCompatible.clear(); @@ -219,7 +219,7 @@ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFil //------------------------------------------------------------------------------ void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) -{ //out << __func__ << endl; +{ mSlicerManagersCompatible.clear(); for(unsigned int i=0; iGetSlicerManagers().size(); i++) { mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); @@ -245,7 +245,7 @@ void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) //------------------------------------------------------------------------------ void vvToolWidgetBase::HideInputSelector() -{ //out << __func__ << endl; +{ mToolInputSelectionWidget->hide(); } //------------------------------------------------------------------------------ @@ -253,7 +253,7 @@ void vvToolWidgetBase::HideInputSelector() //------------------------------------------------------------------------------ void vvToolWidgetBase::show() -{ //out << __func__ << endl; +{ if (!mIsInitialized) { mToolInputSelectionWidget->Initialize(); mIsInitialized = true; @@ -265,7 +265,7 @@ void vvToolWidgetBase::show() //------------------------------------------------------------------------------ void vvToolWidgetBase::closeEvent(QCloseEvent *event) -{ //out << __func__ << endl; +{ mIsAnotherToolWaitInput = false; if (isWindow()) { event->accept();//return QWidget::close(); @@ -292,7 +292,7 @@ void vvToolWidgetBase::closeEvent(QCloseEvent *event) //------------------------------------------------------------------------------ bool vvToolWidgetBase::close() -{ //out << __func__ << endl; +{ QApplication::restoreOverrideCursor(); return QWidget::close(); } @@ -301,7 +301,7 @@ bool vvToolWidgetBase::close() //------------------------------------------------------------------------------ void vvToolWidgetBase::AnImageIsBeingClosed(vvSlicerManager * m) -{ //out << __func__ << endl; +{ mToolInputSelectionWidget->AnImageIsBeingClosed(m); if (m == mCurrentSlicerManager) { close(); @@ -312,7 +312,7 @@ void vvToolWidgetBase::AnImageIsBeingClosed(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolWidgetBase::SwapCurrentWidget() -{ //out << __func__ << endl; +{ mStaticWidgetForTab->setUpdatesEnabled(false); QList l =mStaticWidgetForTab->children(); for(int i=1; isetEnabled(true); std::vector & l = mToolInputSelectionWidget->GetSelectedInputs(); mCurrentSlicerManager = l[0]; @@ -372,7 +372,7 @@ void vvToolWidgetBase::InputIsSelected() //------------------------------------------------------------------------------ void vvToolWidgetBase::InputIsSelected(vvSlicerManager * m) -{ //out << __func__ << endl; +{ std::cerr << "You MUST overwrite this method vvToolWidgetBase::InputIsSelected(vvSlicerManager * m) if you use one single input" << std::endl; exit(0); } @@ -381,7 +381,7 @@ void vvToolWidgetBase::InputIsSelected(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolWidgetBase::InputIsSelected(std::vector & l) -{ //out << __func__ << endl; +{ mMainButtonBox->setEnabled(true); if (l.size() == 1) InputIsSelected(l[0]); else {