From: Vivien Delmon Date: Mon, 30 May 2011 11:59:26 +0000 (+0200) Subject: Merge branch 'master' of /home/dsarrut/clitk3.server X-Git-Tag: v1.3.0~330^2~2^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=aca83815bbe3946ec5656569751f22c1c9c6620d;hp=5a79dfb9e4860dc684c7bde0765c5de2b792891b;p=clitk.git Merge branch 'master' of /home/dsarrut/clitk3.server --- diff --git a/common/clitkDD.h b/common/clitkDD.h index c5b5295..f43db9d 100644 --- a/common/clitkDD.h +++ b/common/clitkDD.h @@ -19,10 +19,20 @@ #define clitkDD_h #include - +#ifdef WIN32 +# include +#endif // David's debug -#define DD(a) std::cout << #a " = [ " << a << " ]" << std::endl;std::cout.flush(); +#ifdef WIN32 +# define DD(a) { \ + std::ostringstream ossDD; \ + ossDD << #a " = [ " << a << " ]" << std::endl; \ + OutputDebugString(ossDD.str().c_str()); \ + } +#else +# define DD(a) std::cout << #a " = [ " << a << " ]" << std::endl;std::cout.flush(); +#endif #define DDV(a,n) { std::cout << #a " = [ "; for(unsigned int _i_=0; _i_ void _print_container(T const& a) diff --git a/common/vvImageReader.h b/common/vvImageReader.h index 06cf8c4..a646a01 100644 --- a/common/vvImageReader.h +++ b/common/vvImageReader.h @@ -42,6 +42,8 @@ public: typedef itk::SmartPointer Pointer; itkNewMacro(Self); + const std::vector& GetInputFilenames(){return mInputFilenames;} + void SetInputFilename(const std::string & filename); void SetInputFilenames(const std::vector & filenames); diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 43dcff1..8a0bd24 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -865,7 +865,7 @@ void vvMainWindow::LoadImages(std::vector files, vvImageReader::Loa item->setData(0,Qt::UserRole,files[i].c_str()); QFileInfo fileinfo(imageManager->GetFileName().c_str()); //Do not show the path item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); - item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); + item->setToolTip(COLUMN_IMAGE_NAME, imageManager->GetListOfAbsoluteFilePathInOneString("image").c_str()); qApp->processEvents(); //Create the buttons for reload and close @@ -1816,7 +1816,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) item->setData(1,Qt::UserRole,tr("overlay")); QFileInfo fileinfo(file); //Do not show the path item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); - item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); + item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("overlay").c_str()); qApp->processEvents(); for (int j = 1; j <= 4; j++) { @@ -1938,7 +1938,7 @@ void vvMainWindow::AddFusionImage(int index, QString file) item->setData(1,Qt::UserRole,tr("fusion")); QFileInfo fileinfo(filename.c_str()); //Do not show the path item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); - item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); + item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("fusion").c_str()); qApp->processEvents(); for (int j = 1; j <= 4; j++) { @@ -2023,7 +2023,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk) item->setData(1,Qt::UserRole,tr("vector")); QFileInfo fileinfo(filename); //Do not show the path item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName()); - item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath()); + item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("vector").c_str()); qApp->processEvents(); for (int j = 1; j <= 4; j++) { diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index 87c4ae3..7bf8ed6 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -40,6 +40,8 @@ #include #include +#include + //---------------------------------------------------------------------------- vvSlicerManager::vvSlicerManager(int numberOfSlicers) { @@ -121,6 +123,34 @@ void vvSlicerManager::ToggleContourSuperposition() } //---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType) +{ + vvImageReader *reader = NULL; + + if(actorType=="image") + reader = mReader; + else if(actorType=="overlay") + reader = mOverlayReader; + else if(actorType=="fusion") + reader = mFusionReader; + else if(actorType=="vector") + reader = mVectorReader; + + if(!reader) + return ""; + + std::string list; + for(unsigned int i=0; iGetInputFilenames().size(); i++){ + QFileInfo fileinfo(reader->GetInputFilenames()[i].c_str()); //Do not show the path + if(i) + list += '\n'; + list += fileinfo.absoluteFilePath().toStdString(); + } + return list; +} +//---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice) diff --git a/vv/vvSlicerManager.h b/vv/vvSlicerManager.h index cb6cb32..680a59b 100644 --- a/vv/vvSlicerManager.h +++ b/vv/vvSlicerManager.h @@ -80,6 +80,7 @@ class vvSlicerManager : public QObject { std::string GetVFName() { return mVFName; } std::string GetOverlayName() { return mOverlayName; } std::string GetFusionName() { return mFusionName; } + std::string GetListOfAbsoluteFilePathInOneString(const std::string &actorType); ///Switch between nearest neighbor and linear interpolation void ToggleInterpolation(); diff --git a/vv/vvToolCreatorBase.cxx b/vv/vvToolCreatorBase.cxx index 671c080..2744dd3 100644 --- a/vv/vvToolCreatorBase.cxx +++ b/vv/vvToolCreatorBase.cxx @@ -22,7 +22,7 @@ #include //------------------------------------------------------------------------------ -vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false) +vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false), mAction(NULL) { mUseContextMenu = false; mToolName = name;