From 1df2c8867c511818511bbd2b0be560325a4944c5 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Tue, 30 Mar 2010 06:40:39 +0000 Subject: [PATCH] - correct "same image name" bug --- cmake/FindROOT.cmake1 | 6 +- common/clitkCommon.cxx | 27 ++- common/clitkCommon.h | 14 +- vv/CMakeLists.txt | 3 + vv/vvMainWindow.cxx | 21 ++- vv/vvMainWindow.h | 8 +- vv/vvMainWindowBase.h | 4 + vv/vvResamplerDialog.cxx | 6 +- vv/vvSlicerManager.cxx | 26 ++- vv/vvSlicerManager.h | 381 +++++++++++++++++++-------------------- vv/vvToolBase.h | 1 + vv/vvToolBaseBase.h | 1 + vv/vvToolConvert.cxx | 1 - vv/vvToolImageArithm.cxx | 1 + vv/vvToolWidgetBase.cxx | 37 ++-- vv/vvToolWidgetBase.h | 5 +- 16 files changed, 290 insertions(+), 252 deletions(-) diff --git a/cmake/FindROOT.cmake1 b/cmake/FindROOT.cmake1 index 4fdc250..d01b212 100644 --- a/cmake/FindROOT.cmake1 +++ b/cmake/FindROOT.cmake1 @@ -82,7 +82,7 @@ IF (ROOT_CONFIG_EXECUTABLE) ENDIF (ROOT_CONFIG_EXECUTABLE) -MESSAGE("root found = "${ROOT_FOUND}) +#MESSAGE("root found = "${ROOT_FOUND}) IF (ROOT_FOUND) @@ -149,7 +149,7 @@ IF (ROOT_FOUND) ENDIF (ROOT_FOUND) -MESSAGE("icici") +#MESSAGE("icici") ########################################### # @@ -226,4 +226,4 @@ MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN) ENDMACRO (ROOT_GENERATE_DICTIONARY) -MESSAGE("la") \ No newline at end of file +#MESSAGE("la") \ No newline at end of file diff --git a/common/clitkCommon.cxx b/common/clitkCommon.cxx index d488e91..fa1c595 100644 --- a/common/clitkCommon.cxx +++ b/common/clitkCommon.cxx @@ -15,18 +15,9 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ + #ifndef CLITKCOMMON_CXX #define CLITKCOMMON_CXX -/** - ------------------------------------------------- - * @file clitkCommon.cxx - * @author David Sarrut - * @date 17 May 2006 07:59:06 - * - * @brief - * - * - -------------------------------------------------*/ #include "clitkCommon.h" #include @@ -278,5 +269,21 @@ void clitk::enableStdCerr() { } //-------------------------------------------------------------------- + +//-------------------------------------------------------------------- +void clitk::readDoubleFromFile(const std::string & filename, std::vector & list) { + std::ifstream is; + clitk::openFileForReading(is, filename); + list.clear(); + while (is) { + clitk::skipComment(is); + double d; + is >> d; + if (is) list.push_back(d); + } +} +//-------------------------------------------------------------------- + + #endif /* end #define CLITKCOMMON_CXX */ diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 2d26e8a..f368946 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -15,20 +15,11 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ + #ifndef CLITKCOMMON_H #define CLITKCOMMON_H -/** - ------------------------------------------------------------------- - * @file clitkCommon.h - * @author David Sarrut - * @date 17 May 2006 07:57:56 - - * @brief - - -------------------------------------------------------------------*/ // clitk include - #include "clitkConfiguration.h" #include "clitkPortability.h" @@ -189,6 +180,9 @@ namespace clitk { void openFileForReading(std::ifstream & is, const std::string & filename); void openFileForWriting(std::ofstream & os, const std::string & filename); + //-------------------------------------------------------------------- + void readDoubleFromFile(const std::string & filename, std::vector & list); + //-------------------------------------------------------------------- double cotan(double i); double invcotan(double i); diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index fb3fc03..e8a5cd8 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -112,6 +112,7 @@ SET(vv_SRCS vvImageContour.cxx vvToolImageArithm.cxx vvToolConvert.cxx +# vvToolStructureSetManager.cxx ) QT4_WRAP_CPP(vv_SRCS @@ -143,6 +144,7 @@ QT4_WRAP_CPP(vv_SRCS vvToolCropImage.h vvToolImageArithm.h vvToolConvert.h +# vvToolStructureSetManager.h ) QT4_WRAP_UI(vv_UI_CXX @@ -169,6 +171,7 @@ QT4_WRAP_UI(vv_UI_CXX qt_ui/vvToolCropImage.ui qt_ui/vvToolBinarize.ui qt_ui/vvToolImageArithm.ui +# qt_ui/vvToolStructureSetManager.ui ) SET(vvUI_RCCS vvIcons.qrc) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 43df4b4..029df0f 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -755,6 +755,8 @@ void vvMainWindow::OpenRecentImage() mInputPathName = itksys::SystemTools::GetFilenamePath(images[0]).c_str(); LoadImages(images,IMAGE); } +//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvMainWindow::OpenImageWithTime() { @@ -774,6 +776,7 @@ void vvMainWindow::OpenImageWithTime() { } //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvMainWindow::LoadImages(std::vector files, LoadedImageType filetype) { //Separate the way to open images and dicoms @@ -809,11 +812,25 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi bool SetImageSucceed=false; + // Change filename if an image with the same already exist + // DD(files[i]); + int number=0; + for(unsigned int l=0; lGetBaseFileName()); + // DD(v->GetFileName()); + if (v->GetBaseFileName() == + vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(files[i]))) { + number = std::max(number, v->GetBaseFileNameNumber()+1); + } + } + + if (filetype == IMAGE || filetype == IMAGEWITHTIME) - SetImageSucceed = imageManager->SetImage(files[i],filetype); + SetImageSucceed = imageManager->SetImage(files[i],filetype, number); else { - SetImageSucceed = imageManager->SetImages(files,filetype); + SetImageSucceed = imageManager->SetImages(files,filetype, number); } if (SetImageSucceed == false) { diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index 54cb659..adfed23 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -15,11 +15,12 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ -#ifndef vvMainWindow_h -#define vvMainWindow_h + +#ifndef VVMAINWINDOW_H +#define VVMAINWINDOW_H + #include #include - #include "ui_vvMainWindow.h" #include "vvMainWindowBase.h" #include "vvToolManager.h" @@ -154,7 +155,6 @@ private: vvDocumentation *documentation; vvDicomSeriesSelector *dicomSeriesSelector; - QString mInputPathName; bool viewMode; bool playMode; diff --git a/vv/vvMainWindowBase.h b/vv/vvMainWindowBase.h index 6123a6e..3ec91c5 100644 --- a/vv/vvMainWindowBase.h +++ b/vv/vvMainWindowBase.h @@ -18,6 +18,7 @@ #ifndef VVMAINWINDOWBASE_H #define VVMAINWINDOWBASE_H + #include "clitkCommon.h" #include "vvImage.h" #include @@ -42,6 +43,7 @@ public: QMenu * GetExperimentalToolMenu() const { return mMenuExperimentalTools; } int GetSlicerManagerCurrentIndex() const { return mSlicerManagerCurrentIndex; } QWidget * GetMainWidget() { return mMainWidget; } + const QString & GetInputPathName() { return mInputPathName; } signals: void AnImageIsBeingClosed(vvSlicerManager *); @@ -53,6 +55,8 @@ protected: QMenu * mMenuExperimentalTools; int mSlicerManagerCurrentIndex; QWidget* mMainWidget; + QString mInputPathName; + }; //------------------------------------------------------------------------------ diff --git a/vv/vvResamplerDialog.cxx b/vv/vvResamplerDialog.cxx index 09bbb20..9e4c3ae 100644 --- a/vv/vvResamplerDialog.cxx +++ b/vv/vvResamplerDialog.cxx @@ -15,8 +15,10 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ -#ifndef _vvResamplerDialog_CXX -#define _vvResamplerDialog_CXX + +#ifndef _VVRESAMPLERDIALOG_CXX +#define _VVRESAMPLERDIALOG_CXX + #include "vvResamplerDialog.h" #include "clitkImageResampleGenericFilter.h" #include "vvSlicer.h" diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index e8bf864..5380192 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -139,7 +139,7 @@ void vvSlicerManager::ToggleContourSuperposition() //---------------------------------------------------------------------------- -bool vvSlicerManager::SetImage(std::string filename,LoadedImageType type) +bool vvSlicerManager::SetImage(std::string filename, LoadedImageType type, int n) { mFileName = filename; mType = type; @@ -149,6 +149,12 @@ bool vvSlicerManager::SetImage(std::string filename,LoadedImageType type) filenames.push_back(filename); mReader->SetInputFilenames(filenames); mReader->Update(type); + + mFileName = vtksys::SystemTools::GetFilenameName(mFileName); + mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName)); + // DD(mBaseFileName); + mBaseFileNameNumber = n; + if (mReader->GetLastError().size() == 0) { mImage=mReader->GetOutput(); @@ -156,6 +162,7 @@ bool vvSlicerManager::SetImage(std::string filename,LoadedImageType type) { mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename)); mSlicers[i]->SetImage(mReader->GetOutput()); + // DD(mSlicers[i]->GetFileName()); } } else @@ -163,6 +170,10 @@ bool vvSlicerManager::SetImage(std::string filename,LoadedImageType type) mLastError = mReader->GetLastError(); return false; } + if (n!=0) { + // DD(mFileName); + mFileName.append("_"+clitk::toString(n)); + } return true; } //---------------------------------------------------------------------------- @@ -181,7 +192,7 @@ void vvSlicerManager::SetImage(vvImage::Pointer image) //---------------------------------------------------------------------------- -bool vvSlicerManager::SetImages(std::vector filenames,LoadedImageType type) +bool vvSlicerManager::SetImages(std::vector filenames,LoadedImageType type, int n) { mType = type; std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]); @@ -192,12 +203,16 @@ bool vvSlicerManager::SetImages(std::vector filenames,LoadedImageTy else if (type == MERGEDWITHTIME) fileWithoutExtension += "_merged_wt"; + mFileName = vtksys::SystemTools::GetFilenameName(mFileName); mFileName = fileWithoutExtension + vtksys::SystemTools::GetFilenameExtension(filenames[0]); if (mReader == NULL) mReader = new vvImageReader; mReader->SetInputFilenames(filenames); mReader->Update(type); + mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName)); + // DD(mBaseFileName); + mBaseFileNameNumber = n; if (mReader->GetLastError().size() == 0) { @@ -213,7 +228,12 @@ bool vvSlicerManager::SetImages(std::vector filenames,LoadedImageTy mLastError = mReader->GetLastError(); return false; } - return true; + if (n!=0) { + // DD(mFileName); + mFileName.append("_"+clitk::toString(n)); + // DD(mFileName); + } + return true; } //---------------------------------------------------------------------------- diff --git a/vv/vvSlicerManager.h b/vv/vvSlicerManager.h index c1da253..7456078 100644 --- a/vv/vvSlicerManager.h +++ b/vv/vvSlicerManager.h @@ -14,7 +14,8 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ + ======================================================================-====*/ + #ifndef VVSLICERMANAGER_H #define VVSLICERMANAGER_H @@ -43,208 +44,192 @@ class vvImageReader; class vvImageReader; class vvLandmarks; +//------------------------------------------------------------------------------ class vvSlicerManager : public QObject { - Q_OBJECT - -public: - vvSlicerManager(int numberOfSlicers); - ~vvSlicerManager(); - - std::string GetLastError() { - return mLastError; - } - - bool SetImage(std::string filename,LoadedImageType type); - void SetImage(vvImage::Pointer image); - void SetExtractedImage(std::string filename, vvImage::Pointer image, int slice); - bool SetImages(std::vector filenames,LoadedImageType type); - - bool SetOverlay(std::string filename, int dim, std::string component); - bool SetFusion(std::string filename, int dim, std::string component); - ///Set a VF by loading it from the disk - bool SetVF(std::string filename); - ///Set a VF from memory - bool SetVF(vvImage::Pointer vf,std::string filename); - ///Add a mesh to the slicers, with optional propagation using a vector field - void AddContour(vvMesh::Pointer ,bool propagate=false); - ///Toggle temporal superposition of contours - void ToggleContourSuperposition(); - - std::string GetFileName() { - return mFileName; - } - std::string GetVFName() { - return mVFName; - } - std::string GetOverlayName() { - return mOverlayName; - } - std::string GetFusionName() { - return mFusionName; - } - - ///Switch between nearest neighbor and linear interpolation - void ToggleInterpolation(); - vvSlicer* GetSlicer(int i); - void UpdateSlicer(int num, bool state); - void SetSlicerWindow(int i, vtkRenderWindow* RW); - void SetInteractorStyleNavigator(int i,vtkInteractorStyle* style); - int NumberOfSlicers() { - return mSlicers.size(); - } - vvImage::Pointer GetImage() { - return mImage; - } - vvImage::Pointer GetVF() { - return mVF; - } - int GetDimension() { - if (mImage) return mImage->GetNumberOfDimensions(); - else return -1; - } - - int GetType() { - return mType; - } - - void SetId(std::string id) { - mId = id; - } - std::string GetId() { - return mId; - } - - void SetFilename(std::string f); - - void SetTSlice(int slice); - void SetNextTSlice(int originating_slicer); - void SetPreviousTSlice(int originating_slicer); - void SetTSliceInSlicer(int tslice, int slicer); - - void GenerateDefaultLookupTable(); - void SetColorWindow(double s); - void SetColorLevel(double s); - void SetLocalColorWindowing(const int slicer); - void SetOpacity(int i, double factor); - void SetColorMap(); - void SetColorMap(int colormap); - void SetPreset(int preset); - void SetOverlayColor(int color) { - mOverlayColor = color; - } - void SetFusionOpacity(int opacity) { - mFusionOpacity = opacity; - } - void SetFusionColorMap(int colorMap) { - mFusionColorMap = colorMap; - } - void SetFusionWindow(int window) { - mFusionWindow = window; - } - void SetFusionLevel(int level) { - mFusionLevel = level; - } - - double GetColorWindow(); - double GetColorLevel(); - int GetColorMap() { - return mColorMap; - } - int GetPreset() { - return mPreset; - } - int GetOverlayColor() { - return mOverlayColor; - } - - int GetFusionOpacity() { - return mFusionOpacity; - } - int GetFusionColorMap() { - return mFusionColorMap; - } - double GetFusionWindow() { - return mFusionWindow; - } - double GetFusionLevel() { - return mFusionLevel; - } - - void SetCursorVisibility(int s); - void UpdateViews(int current, int slicer); - void UpdateLinked(int slicer); - void Render(); - - void AddLink(std::string newId) { - mLinkedId.push_back(newId); - } - void RemoveLink(std::string oldId) { - mLinkedId.remove(oldId); - } - - ///Remove the actor defined by its type and index (example: 3rd contour) - void RemoveActor(const std::string& actor_type, int overlay_index); - void RemoveActors(); - void Reload(); - void ReloadOverlay(); - void ReloadFusion(); - void ReloadVF(); - - void Activated(); - void UpdateInfoOnCursorPosition(int slicer); - void UpdateWindowLevel(); - void UpdateSlice(int slicer); - void UpdateTSlice(int slicer); - void UpdateSliceRange(int slicer); - - vvLandmarks *GetLandmarks(); - void AddLandmark(float x,float y,float z,float t); + Q_OBJECT + + public: + vvSlicerManager(int numberOfSlicers); + ~vvSlicerManager(); + + std::string GetLastError() { + return mLastError; + } + + bool SetImage(std::string filename,LoadedImageType type, int n=0); + void SetImage(vvImage::Pointer image); + void SetExtractedImage(std::string filename, vvImage::Pointer image, int slice); + bool SetImages(std::vector filenames, LoadedImageType type, int n=0); + + bool SetOverlay(std::string filename, int dim, std::string component); + bool SetFusion(std::string filename, int dim, std::string component); + ///Set a VF by loading it from the disk + bool SetVF(std::string filename); + ///Set a VF from memory + bool SetVF(vvImage::Pointer vf,std::string filename); + ///Add a mesh to the slicers, with optional propagation using a vector field + void AddContour(vvMesh::Pointer ,bool propagate=false); + ///Toggle temporal superposition of contours + void ToggleContourSuperposition(); + + std::string GetFileName() { return mFileName; } + std::string GetBaseFileName() { return mBaseFileName; } + int GetBaseFileNameNumber() { return mBaseFileNameNumber; } + std::string GetVFName() { return mVFName; } + std::string GetOverlayName() { return mOverlayName; } + std::string GetFusionName() { return mFusionName; } + + ///Switch between nearest neighbor and linear interpolation + void ToggleInterpolation(); + vvSlicer* GetSlicer(int i); + void UpdateSlicer(int num, bool state); + void SetSlicerWindow(int i, vtkRenderWindow* RW); + void SetInteractorStyleNavigator(int i,vtkInteractorStyle* style); + + int NumberOfSlicers() { return mSlicers.size(); } + vvImage::Pointer GetImage() { return mImage; } + vvImage::Pointer GetVF() { return mVF; } + int GetType() { return mType; } + void SetId(std::string id) { mId = id; } + std::string GetId() { return mId; } + int GetDimension() { + if (mImage) return mImage->GetNumberOfDimensions(); + else return -1; + } + + void SetFilename(std::string f); + + void SetTSlice(int slice); + void SetNextTSlice(int originating_slicer); + void SetPreviousTSlice(int originating_slicer); + void SetTSliceInSlicer(int tslice, int slicer); + + void GenerateDefaultLookupTable(); + void SetColorWindow(double s); + void SetColorLevel(double s); + void SetLocalColorWindowing(const int slicer); + void SetOpacity(int i, double factor); + void SetColorMap(); + void SetColorMap(int colormap); + void SetPreset(int preset); + void SetOverlayColor(int color) { + mOverlayColor = color; + } + void SetFusionOpacity(int opacity) { + mFusionOpacity = opacity; + } + void SetFusionColorMap(int colorMap) { + mFusionColorMap = colorMap; + } + void SetFusionWindow(int window) { + mFusionWindow = window; + } + void SetFusionLevel(int level) { + mFusionLevel = level; + } + + double GetColorWindow(); + double GetColorLevel(); + int GetColorMap() { + return mColorMap; + } + int GetPreset() { + return mPreset; + } + int GetOverlayColor() { + return mOverlayColor; + } + + int GetFusionOpacity() { + return mFusionOpacity; + } + int GetFusionColorMap() { + return mFusionColorMap; + } + double GetFusionWindow() { + return mFusionWindow; + } + double GetFusionLevel() { + return mFusionLevel; + } + + void SetCursorVisibility(int s); + void UpdateViews(int current, int slicer); + void UpdateLinked(int slicer); + void Render(); + + void AddLink(std::string newId) { + mLinkedId.push_back(newId); + } + void RemoveLink(std::string oldId) { + mLinkedId.remove(oldId); + } + + ///Remove the actor defined by its type and index (example: 3rd contour) + void RemoveActor(const std::string& actor_type, int overlay_index); + void RemoveActors(); + void Reload(); + void ReloadOverlay(); + void ReloadFusion(); + void ReloadVF(); + + void Activated(); + void UpdateInfoOnCursorPosition(int slicer); + void UpdateWindowLevel(); + void UpdateSlice(int slicer); + void UpdateTSlice(int slicer); + void UpdateSliceRange(int slicer); + + vvLandmarks *GetLandmarks(); + void AddLandmark(float x,float y,float z,float t); signals : - void currentImageChanged(std::string id); - void UpdatePosition(int visibility,double x, double y, double z, double X, double Y, double Z, double value); - void UpdateVector(int display, double x, double y, double z, double value); - void UpdateOverlay(int display, double valueOver, double valueRef); - void UpdateFusion(int display, double valueFus); - void UpdateWindows(int slicer, int view, int slice); - void UpdateSlice(int slicer, int slice); - void UpdateTSlice(int slicer, int slice); - void UpdateSliceRange(int slice, int min, int max, int tmin, int tmax); - void WindowLevelChanged(double window, double level, int preset, int colormap); - void UpdateLinkManager(std::string, int slicer, double x, double y, double z, int temps); - void LandmarkAdded(); + void currentImageChanged(std::string id); + void UpdatePosition(int visibility,double x, double y, double z, double X, double Y, double Z, double value); + void UpdateVector(int display, double x, double y, double z, double value); + void UpdateOverlay(int display, double valueOver, double valueRef); + void UpdateFusion(int display, double valueFus); + void UpdateWindows(int slicer, int view, int slice); + void UpdateSlice(int slicer, int slice); + void UpdateTSlice(int slicer, int slice); + void UpdateSliceRange(int slice, int min, int max, int tmin, int tmax); + void WindowLevelChanged(double window, double level, int preset, int colormap); + void UpdateLinkManager(std::string, int slicer, double x, double y, double z, int temps); + void LandmarkAdded(); protected: - std::vector mSlicers; - vvImageReader* mReader; - vvImageReader* mOverlayReader; - vvImageReader* mFusionReader; - vvImage::Pointer mImage; - vvImage::Pointer mVF; - vvImageReader* mVectorReader; - int mColorMap; - int mOverlayColor; - - int mFusionOpacity; - int mFusionColorMap; - double mFusionWindow; - double mFusionLevel; - - int mPreset; - LoadedImageType mType; - std::string mVFComponent; - std::string mOverlayComponent; - std::string mFusionComponent; - std::string mFileName; - std::string mId; - std::string mVFName; - std::string mOverlayName; - std::string mFusionName; - std::string mVFId; - std::string mLastError; - std::list mLinkedId; - - vvLandmarks* mLandmarks; + std::vector mSlicers; + vvImageReader* mReader; + vvImageReader* mOverlayReader; + vvImageReader* mFusionReader; + vvImage::Pointer mImage; + vvImage::Pointer mVF; + vvImageReader* mVectorReader; + int mColorMap; + int mOverlayColor; + + int mFusionOpacity; + int mFusionColorMap; + double mFusionWindow; + double mFusionLevel; + + int mPreset; + LoadedImageType mType; + std::string mVFComponent; + std::string mOverlayComponent; + std::string mFusionComponent; + std::string mFileName; + std::string mBaseFileName; + int mBaseFileNameNumber; + std::string mId; + std::string mVFName; + std::string mOverlayName; + std::string mFusionName; + std::string mVFId; + std::string mLastError; + std::list mLinkedId; + + vvLandmarks* mLandmarks; }; #endif diff --git a/vv/vvToolBase.h b/vv/vvToolBase.h index a662950..e1d9b9d 100644 --- a/vv/vvToolBase.h +++ b/vv/vvToolBase.h @@ -18,6 +18,7 @@ #ifndef VVTOOLBASE_H #define VVTOOLBASE_H + #include "vvToolBaseBase.h" #include "vvToolCreator.h" diff --git a/vv/vvToolBaseBase.h b/vv/vvToolBaseBase.h index 4a9f4af..74cd25b 100644 --- a/vv/vvToolBaseBase.h +++ b/vv/vvToolBaseBase.h @@ -18,6 +18,7 @@ #ifndef VVTOOLBASEBASE_H #define VVTOOLBASEBASE_H + #include "vvMainWindowBase.h" //------------------------------------------------------------------------------ diff --git a/vv/vvToolConvert.cxx b/vv/vvToolConvert.cxx index 5184ee2..d63a4ea 100644 --- a/vv/vvToolConvert.cxx +++ b/vv/vvToolConvert.cxx @@ -76,7 +76,6 @@ void vvToolConvert::Initialize() { mListOfPixelTypeIcons.push_back(":/common/icons/2b.png"); mListOfPixelTypeIcons.push_back(":/common/icons/4b.png"); mListOfPixelTypeIcons.push_back(":/common/icons/4b.png"); - mListOfPixelTypeIcons.push_back(":/common/icons/4b.png"); mListOfPixelTypeIcons.push_back(":/common/icons/8b.png"); for(unsigned int i=0; isetToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str())); - for(unsigned int i=0; iGetSlicerManagers().size(); i++) { + for(unsigned int i=0; iGetSlicerManagers().size(); i++) { // DD(i); - vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage(); + vvImage * s = mMainWindow->GetSlicerManagers()[i]->GetImage(); // DD(s->GetScalarTypeAsString()); if (mFilter->CheckImageType(s->GetNumberOfDimensions(), s->GetNumberOfScalarComponents(), s->GetScalarTypeAsString())) { - mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]); - if ((int)i == mMainWindowBase->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j; + mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); + if ((int)i == mMainWindow->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j; j++; } } @@ -100,18 +101,18 @@ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFil //------------------------------------------------------------------------------ void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) { // DD("AddInput without filter"); - // DD(mMainWindowBase->GetSlicerManagers().size()); + // DD(mMainWindow->GetSlicerManagers().size()); mSlicerManagersCompatible.clear(); - for(unsigned int i=0; iGetSlicerManagers().size(); i++) { - mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]); + for(unsigned int i=0; iGetSlicerManagers().size(); i++) { + mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); } - if (mMainWindowBase->GetSlicerManagers().size() == 0) { + if (mMainWindow->GetSlicerManagers().size() == 0) { QMessageBox::information(this, "No image","Sorry, could not perform operation. No opened image type."); close(); return; } - mToolInputSelectionWidget->AddInputSelector(s, mMainWindowBase->GetSlicerManagers(), - mMainWindowBase->GetSlicerManagerCurrentIndex(), allowSkip); + mToolInputSelectionWidget->AddInputSelector(s, mMainWindow->GetSlicerManagers(), + mMainWindow->GetSlicerManagerCurrentIndex(), allowSkip); } //------------------------------------------------------------------------------ @@ -152,20 +153,20 @@ void vvToolWidgetBase::InitializeInputs() { if (mFilter) { int j=0; mToolInputSelectionWidget->setToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str())); - for(unsigned int i=0; iGetSlicerManagers().size(); i++) { - vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage(); + for(unsigned int i=0; iGetSlicerManagers().size(); i++) { + vvImage * s = mMainWindow->GetSlicerManagers()[i]->GetImage(); if (mFilter->CheckImageType(s->GetNumberOfDimensions(), s->GetNumberOfScalarComponents(), s->GetScalarTypeAsString())) { - mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]); - if ((int)i == mMainWindowBase->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j; + mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); + if ((int)i == mMainWindow->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j; j++; } } } else { - mSlicerManagersCompatible = mMainWindowBase->GetSlicerManagers(); - mCurrentCompatibleIndex = mMainWindowBase->GetSlicerManagerCurrentIndex(); + mSlicerManagersCompatible = mMainWindow->GetSlicerManagers(); + mCurrentCompatibleIndex = mMainWindow->GetSlicerManagerCurrentIndex(); } mToolInputSelectionWidget->Initialize(mSlicerManagersCompatible, mCurrentCompatibleIndex); diff --git a/vv/vvToolWidgetBase.h b/vv/vvToolWidgetBase.h index 83f4dcb..a157f38 100644 --- a/vv/vvToolWidgetBase.h +++ b/vv/vvToolWidgetBase.h @@ -15,11 +15,14 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ + #ifndef VVTOOLWIDGETBASE_H #define VVTOOLWIDGETBASE_H + #include #include "ui_vvToolWidgetBase.h" #include "clitkImageToImageGenericFilter.h" + class vvMainWindowBase; //------------------------------------------------------------------------------ @@ -49,7 +52,7 @@ protected: void InitializeInputs(); Ui::vvToolWidgetBase ui; clitk::ImageToImageGenericFilterBase * mFilter; - vvMainWindowBase * mMainWindowBase; + vvMainWindowBase * mMainWindow; std::vector mSlicerManagersCompatible; vvSlicerManager * mCurrentSlicerManager; int mCurrentCompatibleIndex; -- 2.47.1