From e7d3c47803d3341d27c134738499e92a1fef426c Mon Sep 17 00:00:00 2001 From: Juan Prieto Date: Fri, 20 Nov 2009 17:09:01 +0000 Subject: [PATCH] MIP function --- bbtk/src/bbcreaMaracasVisuCutModule2.cxx | 59 ---- bbtk/src/bbcreaMaracasVisuCutModule2.h | 46 --- bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx | 14 +- .../src/bbmaracasvisuTransferFunctionView.cxx | 7 +- bbtk/src/bbmaracasvisuViewerNV.cxx | 7 +- install/CMakeLists.txt | 2 +- lib/maracasVisuLib/src/CMakeLists.txt | 1 - .../src/CutModule/kernel/CutModelManager2.cxx | 280 ------------------ ...wxMaracasMultipleVolumeRendererManager.cxx | 8 +- .../wxMaracasMultipleVolumeRendererManager.h | 6 +- ...racasMultipleVolumeRendererManagerData.cxx | 23 +- ...MaracasMultipleVolumeRendererManagerData.h | 6 +- .../wxMaracasMultipleVolumeRendererPanel.cxx | 19 +- .../wxMaracasMultipleVolumeRendererPanel.h | 2 + .../wxMaracasMultipleVolumeRendererView.cxx | 15 +- .../wxMaracasMultipleVolumeRendererView.h | 6 +- 16 files changed, 91 insertions(+), 410 deletions(-) delete mode 100644 bbtk/src/bbcreaMaracasVisuCutModule2.cxx delete mode 100644 bbtk/src/bbcreaMaracasVisuCutModule2.h delete mode 100644 lib/maracasVisuLib/src/CutModule/kernel/CutModelManager2.cxx diff --git a/bbtk/src/bbcreaMaracasVisuCutModule2.cxx b/bbtk/src/bbcreaMaracasVisuCutModule2.cxx deleted file mode 100644 index bfc09ac..0000000 --- a/bbtk/src/bbcreaMaracasVisuCutModule2.cxx +++ /dev/null @@ -1,59 +0,0 @@ -#include "bbcreaMaracasVisuCutModule2.h" -#include "bbcreaMaracasVisuPackage.h" -#include "creaSystem.h" - -namespace bbcreaMaracasVisu -{ - -BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,CutModule2) -BBTK_BLACK_BOX_IMPLEMENTATION(CutModule2,bbtk::WxBlackBox); -void CutModule2::Process() -{ - - vtkImageData* img = bbGetInputIn(); - vtkRenderWindowInteractor* interactor = bbGetInputInteractor(); - vtkRenderer* render = bbGetInputRenderer(); - - if(img != NULL && interactor != NULL && render != NULL && _mainpanel!=NULL){ - - if(_currentimage!=img){ - _currentimage=img; - _mainpanel->setImageData(img); - } - - _mainpanel->setInteractor(interactor); - _mainpanel->setRenderer(render); - //bbSetOutputOut(_mainpanel->GetResultImage()); - - } - -} -void CutModule2::CreateWidget(wxWindow* parent) -{ - - std::string path = crea::System::GetDllAppPath("bbcreaMaracasVisu.dll"); - _mainpanel = CutModel2MainPanel::getInstance(parent, path); - - bbSetOutputWidget( _mainpanel); - Process(); - -} -void CutModule2::bbUserSetDefaultValues() -{ - _mainpanel = NULL; - _currentimage=NULL; -} -void CutModule2::bbUserInitializeProcessing() -{ - bbSetInputIn(0); - bbSetInputInteractor(0); - bbSetInputRenderer(0); -} -void CutModule2::bbUserFinalizeProcessing() -{ - -} -} -// EO namespace bbcreaMaracasVisu - - diff --git a/bbtk/src/bbcreaMaracasVisuCutModule2.h b/bbtk/src/bbcreaMaracasVisuCutModule2.h deleted file mode 100644 index 3f5e1b2..0000000 --- a/bbtk/src/bbcreaMaracasVisuCutModule2.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifdef _USE_WXWIDGETS_ -#ifndef __bbcreaMaracasVisuCutModule2_h_INCLUDED__ -#define __bbcreaMaracasVisuCutModule2_h_INCLUDED__ -#include "bbcreaMaracasVisu_EXPORT.h" -#include "bbtkWxBlackBox.h" -#include "CutModel2MainPanel.h" - -namespace bbcreaMaracasVisu -{ - -class bbcreaMaracasVisu_EXPORT CutModule2 - : - public bbtk::WxBlackBox -{ - - BBTK_BLACK_BOX_INTERFACE(CutModule2,bbtk::WxBlackBox); - BBTK_DECLARE_INPUT(In,vtkImageData*); - BBTK_DECLARE_INPUT(Interactor,vtkRenderWindowInteractor*); - BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); - //BBTK_DECLARE_OUTPUT(Out,vtkImageData*); - BBTK_PROCESS(Process); - void Process(); - BBTK_CREATE_WIDGET(CreateWidget); - void CreateWidget(wxWindow*); - -private: - CutModel2MainPanel* _mainpanel; - vtkImageData* _currentimage; -}; - -BBTK_BEGIN_DESCRIBE_BLACK_BOX(CutModule2,bbtk::WxBlackBox); -BBTK_NAME("CutModule2"); -BBTK_AUTHOR("perez@creatis.insa-lyon.fr"); -BBTK_DESCRIPTION("extracts"); -BBTK_CATEGORY("__CategoryBlackBox__"); -BBTK_INPUT(CutModule2,In,"Image",vtkImageData*,""); -BBTK_INPUT(CutModule2,Interactor,"WindowInteractor",vtkRenderWindowInteractor*,""); -BBTK_INPUT(CutModule2,Renderer,"Renderer",vtkRenderer*,""); -//BBTK_OUTPUT(CutModule2,Out,"Image output",vtkImageData*,""); -BBTK_END_DESCRIBE_BLACK_BOX(CutModel2); -} -// EO namespace bbcreaMaracasVisu - -#endif // __bbcreaMaracasVisuCutModule2_h_INCLUDED__ -#endif // _USE_WXWIDGETS_ - diff --git a/bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx b/bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx index 5e1015a..0a9305b 100644 --- a/bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx +++ b/bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx @@ -47,13 +47,17 @@ void VolumeRendering::Process() if(_img4 !=NULL){ volview->addVolume(_img4, "INPUT 4"); } - } + } + + vtkImageData* img1 = volview->GetOutputImages()[0]; + + bbSetOutputOut0(img1); + bbSetOutputOut1(volview->GetOutputImages()[1]); + bbSetOutputOut2(volview->GetOutputImages()[2]); + bbSetOutputOut3(volview->GetOutputImages()[3]); } - bbSetOutputOut0(volview->GetOutputImages()[0]); - bbSetOutputOut1(volview->GetOutputImages()[1]); - bbSetOutputOut2(volview->GetOutputImages()[2]); - bbSetOutputOut3(volview->GetOutputImages()[3]); + } diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx index 5d2e294..4a25107 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx @@ -57,12 +57,12 @@ void TransferFunctionView::onColorChange(){ _tfun->RemoveAllPoints(); for(int i = 0; i < greylevel.size();i++){ _tfun->AddPoint(greylevel[i], value[i]); - //std::cout<<"TransferFunctionView::Process()transfer function "<RemoveAllPoints(); for(int i = 0; i < greylevelcolors.size();i++){ _ctfun->AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); - //std::cout<<"TransferFunctionView::Process()transfer color function "<SetClamping(-1); bbSetInputIn(NULL); } diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 435655f..dcb478c 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -115,7 +115,12 @@ void ViewerNV::Process() mwxwidget->setWindowLevel(bbGetInputWindowLevel()); } if(bbGetInputColorLevel()!=-1){ - mwxwidget->setColorLevel(bbGetInputColorLevel()); + if(bbGetInputColorLevel() == 0){ + std::cout<<"colorlevel "<setColorLevel(0.1); + }else{ + mwxwidget->setColorLevel(bbGetInputColorLevel()); + } } } } diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 017c99b..16fbe53 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -70,7 +70,7 @@ IF(WIN32 AND NOT UNIX) SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}") SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}") SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr") - SET(CPACK_NSIS_MODIFY_PATH ON) + #SET(CPACK_NSIS_MODIFY_PATH ON) ELSE(WIN32 AND NOT UNIX) # SET(CPACK_STRIP_FILES "bin/bbi") SET(CPACK_SOURCE_STRIP_FILES "") diff --git a/lib/maracasVisuLib/src/CMakeLists.txt b/lib/maracasVisuLib/src/CMakeLists.txt index 1182ea5..b3b3a69 100644 --- a/lib/maracasVisuLib/src/CMakeLists.txt +++ b/lib/maracasVisuLib/src/CMakeLists.txt @@ -1,2 +1 @@ SUBDIRS(CutModule) - diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager2.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager2.cxx deleted file mode 100644 index 97e02a3..0000000 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager2.cxx +++ /dev/null @@ -1,280 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: CutModelManager2.cxx,v $ - Language: C++ - Date: $Date: 2009/11/19 15:01:30 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#include "CutModelManager.h" - -/** -** Start of the manager class -**/ -CutModelManager::CutModelManager(std::string path){ - _path = path; - _img = NULL; - _copyimg = NULL; - _interactor = NULL; - _render = NULL; - _currentaction=0; -} -CutModelManager::~CutModelManager(){ - std::string files = _path; - files+="/infounrd_0_fig_0.info"; - remove(files.c_str()); -} - - -void CutModelManager::setImageData(vtkImageData* img){ - _img = img; - if(_copyimg!=NULL){ - _copyimg->Delete(); - } - _copyimg = vtkImageData::New(); - _copyimg->SetExtent(_img->GetExtent()); - _copyimg->SetSpacing(_img->GetSpacing()); - _copyimg->AllocateScalars(); - - _copyimg->DeepCopy(_img); - -} - -void CutModelManager::setInteractor(vtkRenderWindowInteractor* interactor){ - _interactor = interactor; -} - -void CutModelManager::setRenderer(vtkRenderer* renderer){ - _render = renderer; -} - -void CutModelManager::onAddCutModel(int id, vtkCommand* observer) throw( CutModelException){ - checkInvariant(); - - CutModelData* data = new CutModelData(id,_interactor, observer, _img); - _vectordata.push_back(data); - - _render->AddActor(data->getActor()); - - //_render->UpdateCamera(); - _render->Render(); -} - -void CutModelManager::checkInvariant() throw( CutModelException){ - if(_img==NULL){ - throw CutModelException("The image is not set"); - } - if(_copyimg==NULL){ - throw CutModelException("The image is not set"); - } - if(_interactor==NULL){ - throw CutModelException("Interactor not set"); - } - if(_render==NULL){ - throw CutModelException("Render not set"); - } -} - -double* CutModelManager::getImageRange()throw( CutModelException){ - checkInvariant(); - return _img->GetScalarRange(); -} - -void CutModelManager::changeOpacity(int id,int opacity)throw( CutModelException){ - checkInvariant(); - CutModelData* current = getCutModelData(id); - current->changeOpacity(opacity); -} - -void CutModelManager::ShowViewBox(int id,bool check)throw( CutModelException){ - checkInvariant(); - CutModelData* current = getCutModelData(id); - current->ShowViewBox(check); -} - -void CutModelManager::ChangeShape(int id,int selection)throw( CutModelException){ - checkInvariant(); - CutModelData* current = getCutModelData(id); - current->ChangeShape(selection); - _render->Render(); -} - -CutModelData* CutModelManager::getCutModelData(int id)throw( CutModelException){ - - CutModelData* current = NULL; - for(int i= 0; i < _vectordata.size();i++){ - std::cout<<"id in CutModelManager:: "<getId()<getId()==id){ - current = _vectordata[i]; - } - } - if(current ==NULL){ - - throw CutModelException("Data not found"); - } - return current; -} - -void CutModelManager::updateActorDirection(int id)throw( CutModelException){ - checkInvariant(); - CutModelData* current = getCutModelData(id); - current->udapteActorDirection(); - -} - -void CutModelManager::changeColor(int id,double r,double g,double b)throw( CutModelException){ - - checkInvariant(); - CutModelData* current = getCutModelData(id); - current->changeColor(r,g,b); - _render->Render(); -} -void CutModelManager::RemoveActor(int id)throw( CutModelException){ - - checkInvariant(); - - CutModelData* current = getCutModelData(id); - for(int i = 0; i < _vectordata.size()-1;i++){ - if(_vectordata[i]->getId()==id){ - for(int j = i; j < _vectordata.size()-1;j++){ - _vectordata[j]=_vectordata[j+1]; - } - i = _vectordata.size(); - } - } - _render->RemoveActor(current->getActor()); - delete current; - _vectordata.pop_back(); - _render->Render(); - -} - -void CutModelManager::ExecuteCut(int id, double* range, bool isinside)throw( CutModelException){ - checkInvariant(); - - CutModelData* current = getCutModelData(id); - current->ExecuteCut(range, isinside, _img); - - - /* - Setting extra information for the undo - */ - CutModelSaveBinInfo* undoaction = this->AddActionUndo(id, CUTMODEL_CUT); - undoaction->setRange(range); - undoaction->setIsInside(isinside); - -} - -vtkImageData* CutModelManager::GetResultImage(){ - checkInvariant(); - return _copyimg; -} - -void CutModelManager::RefreshActor(int id){ - checkInvariant(); - CutModelData* current = getCutModelData(id); - _render->RemoveActor(current->getActor()); - _render->AddActor(current->getActor()); - current->RefreshViewBox(); - _render->Render(); -} - -void CutModelManager::SaveCutModelData(std::string filename)throw( CutModelException){ - - - throw CutModelException("not implemented"); - - - - -} - - - -void CutModelManager::LoadCutModelData(std::string filename)throw( CutModelException){ - - throw CutModelException("not implemented"); - -} - -CutModelSaveBinInfo* CutModelManager::AddActionUndo(int idc, UNDOTYPE type)throw( CutModelException){ - - for(int i = _undoredo.size()-1; i > _currentaction;i--){ - delete _undoredo[i]; - _undoredo.pop_back(); - } - - CutModelSaveBinInfo* cutmodel = new CutModelSaveBinInfo(idc, _currentaction, type, _path); - if(type == CUTMODEL_CUT){ - cutmodel->saveMatrix4x4(this->getCutModelData(idc)->getCurrentMatrix()->GetMatrix()); - cutmodel->setCurrentShape(this->getCutModelData(idc)->getCurrentShape()); - } - - _undoredo.push_back(cutmodel); - - _currentaction++;// = _undoredo.size(); - //std::cout<<"current index "<<_currentaction; - - return cutmodel; -} - -int CutModelManager::Undo() throw( CutModelException){ - //&& _currentaction < _undoredo.size() - if(_currentaction > 0){ - int tempaction = _currentaction-1; - CutModelSaveBinInfo* currentundo = _undoredo[tempaction]; - CutModelData* currentmodel; - - if(currentundo->getActionType()==CUTMODEL_CUT){ - //Undo the cut - vtkTransform* transform = currentundo->getTransformFromMatrixFile(); - - currentmodel = getCutModelData(currentundo->getId()); - - currentmodel->setTransform(transform, _copyimg); - - currentmodel->setCurrentShape(currentundo->getCurrentShape()); - - currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img, _copyimg); - - } - //Every thing ok - _currentaction--; - return 0; - } - return -1; -} - -int CutModelManager::Redo() throw( CutModelException){ - - if(_currentaction >= 0 && _currentaction < _undoredo.size()){ - - - CutModelSaveBinInfo* currentundo = _undoredo[_currentaction]; - CutModelData* currentmodel; - - if(currentundo->getActionType()==CUTMODEL_CUT){ - //Redo the cut - vtkTransform* transform = currentundo->getTransformFromMatrixFile(); - currentmodel = getCutModelData(currentundo->getId()); - currentmodel->setTransform(transform, _copyimg); - currentmodel->setCurrentShape(currentundo->getCurrentShape()); - currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _copyimg); - } - - _currentaction++; - - return 0; - } - return -1; -} \ No newline at end of file diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx index 3158ef9..3b279a7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracasMultipleVolumeRendererManager.cxx,v $ Language: C++ - Date: $Date: 2009/11/18 13:13:25 $ - Version: $Revision: 1.8 $ + Date: $Date: 2009/11/20 17:09:05 $ + Version: $Revision: 1.9 $ Copyright: (c) 2002, 2003 License: @@ -197,3 +197,7 @@ vtkColorTransferFunction* wxMaracasMultipleVolumeRendererManager::GetColorFuncti return getViewData(volumeid)->GetColorFunction(); } + +void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *){ + getViewData(id)->changeCompositeMIPFunction(function); +} \ No newline at end of file diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h index 6b881ec..4fac4e7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracasMultipleVolumeRendererManager.h,v $ Language: C++ - Date: $Date: 2009/11/17 10:22:59 $ - Version: $Revision: 1.6 $ + Date: $Date: 2009/11/20 17:09:05 $ + Version: $Revision: 1.7 $ Copyright: (c) 2002, 2003 License: @@ -90,6 +90,8 @@ public: ** Given an id search the data in the vector **/ wxMaracasMultipleVolumeRendererManagerData* getViewData(int id)throw(char*); + + void changeCompositeMIPFunction(int id, int function) throw (char *); /** ** Deletes given actor diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx index 8f2175d..06ceb98 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx @@ -15,6 +15,8 @@ wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManag _volumePlanes = vtkPlanes::New(); _compositeFunction = vtkVolumeRayCastCompositeFunction::New(); + _MIPFunction = vtkVolumeRayCastMIPFunction::New(); + _volumeMapper = vtkVolumeRayCastMapper::New(); _volumeMapper->SetVolumeRayCastFunction(_compositeFunction); _volumeMapper->SetClippingPlanes( _volumePlanes ); @@ -79,8 +81,16 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vectorSetVolumeRayCastFunction(_compositeFunction); + }else{ + _volumeMapper->SetVolumeRayCastFunction(_MIPFunction); + } + +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h index 3494bfb..0f39551 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -24,7 +25,7 @@ public: /** ** Check if the variables are setted correctly **/ - void checkInvariant(); + void checkInvariant()throw (char *); /** ** Updates volume @@ -76,6 +77,8 @@ public: vtkColorTransferFunction* GetColorFunction(){ return _ctfun; } + + void changeCompositeMIPFunction(int function) throw (char *); protected: /** @@ -102,6 +105,7 @@ private: vtkVolume *_newvol; vtkPiecewiseFunction* _tfun; vtkColorTransferFunction* _ctfun; + vtkVolumeRayCastMIPFunction* _MIPFunction; }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx index bbbd73b..d509fd9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx @@ -50,13 +50,20 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){ { wxStaticText* label = new wxStaticText(this, -1, wxString(_T(""))); wxStaticText* label2 = new wxStaticText(this, -1, wxString(_T(""))); + + checkbox = new wxCheckBox(this,-1,wxString(_T("Show Actor"))); Connect(checkbox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onCheckBoxChange); checkbox->SetValue(true); + wxString choices[] = {_T("Composite"), _T("MIP")}; + _radiobox = new wxRadioBox(this, -1, wxString(_T("Function")), wxDefaultPosition, wxDefaultSize, 2, choices); + Connect(_radiobox->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onRadioBoxSelectFunction); + sizerirmprop->Add(checkbox,wxFIXED_MINSIZE); - sizerirmprop->Add(label,wxFIXED_MINSIZE); - sizerirmprop->Add(label2,wxFIXED_MINSIZE); + sizerirmprop->AddSpacer(5); + sizerirmprop->Add(_radiobox,wxFIXED_MINSIZE); + //sizerirmprop->Add(label2,wxFIXED_MINSIZE); } //wxBitmap bitmap(Color_xpm); //_colorchoose = new wxBitmapButton(this, -1, bitmap,wxDefaultPosition,wxSize(30,30)); @@ -237,10 +244,16 @@ int wxMaracasMultipleVolumeRendererPanel::getPropId(){ return _propid; } +void wxMaracasMultipleVolumeRendererPanel::onRadioBoxSelectFunction(wxCommandEvent& event){ + + wxMaracasMultipleVolumeRendererView::getInstance()->changeCompositeMIPFunction(this->getPropId(), _radiobox->GetSelection()); +} + /** ** Carolina Perez: Recently added method **/ HistogramDialogComboBox* wxMaracasMultipleVolumeRendererPanel::getMwxwidget() { return mwxwidget; -} \ No newline at end of file +} + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.h index 44ee843..9bebed2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.h @@ -16,6 +16,7 @@ public: void onCancel(wxCommandEvent& event); void onUpdate(wxCommandEvent& event); void onViewImage(wxCommandEvent& event); + void onRadioBoxSelectFunction(wxCommandEvent& event); void updateVolume(); int getPropId(); @@ -23,6 +24,7 @@ public: private: wxCheckBox* checkbox; + wxRadioBox* _radiobox; wxBitmapButton* _viewimage; int _propid; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx index 56b3015..dc3ee24 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracasMultipleVolumeRendererView.cxx,v $ Language: C++ - Date: $Date: 2009/11/19 15:01:18 $ - Version: $Revision: 1.8 $ + Date: $Date: 2009/11/20 17:09:05 $ + Version: $Revision: 1.9 $ Copyright: (c) 2002, 2003 License: @@ -70,6 +70,17 @@ wxMaracasMultipleVolumeRendererView* wxMaracasMultipleVolumeRendererView::getIns return instance; } +void wxMaracasMultipleVolumeRendererView::changeCompositeMIPFunction(int id, int function){ + try{ + volmanager->changeCompositeMIPFunction(id, function); + } + catch(char* str){ + std::cout << "Exception : " << str << '\n'; + wxMessageDialog* diag = new wxMessageDialog(this, wxString( str,wxConvUTF8 ), wxString( str,wxConvUTF8 ), wxICON_ERROR); + diag->ShowModal(); + } +} + void wxMaracasMultipleVolumeRendererView::setRenderer(vtkRenderer* renderer){ volmanager->setRenderer(renderer); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.h index 6c3f596..09cb529 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.h @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracasMultipleVolumeRendererView.h,v $ Language: C++ - Date: $Date: 2009/11/19 15:01:18 $ - Version: $Revision: 1.4 $ + Date: $Date: 2009/11/20 17:09:05 $ + Version: $Revision: 1.5 $ Copyright: (c) 2002, 2003 License: @@ -67,6 +67,8 @@ public: std::vector GetOutputImages(); + void changeCompositeMIPFunction(int id, int function); + private: static wxMaracasMultipleVolumeRendererView* instance; -- 2.46.0