]> Creatis software - creaMaracasVisu.git/commitdiff
MIP function
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Fri, 20 Nov 2009 17:09:01 +0000 (17:09 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Fri, 20 Nov 2009 17:09:01 +0000 (17:09 +0000)
16 files changed:
bbtk/src/bbcreaMaracasVisuCutModule2.cxx [deleted file]
bbtk/src/bbcreaMaracasVisuCutModule2.h [deleted file]
bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx
bbtk/src/bbmaracasvisuTransferFunctionView.cxx
bbtk/src/bbmaracasvisuViewerNV.cxx
install/CMakeLists.txt
lib/maracasVisuLib/src/CMakeLists.txt
lib/maracasVisuLib/src/CutModule/kernel/CutModelManager2.cxx [deleted file]
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.h

diff --git a/bbtk/src/bbcreaMaracasVisuCutModule2.cxx b/bbtk/src/bbcreaMaracasVisuCutModule2.cxx
deleted file mode 100644 (file)
index bfc09ac..0000000
+++ /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 (file)
index 3f5e1b2..0000000
+++ /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_
-
index 5e1015afe9a08f2603080d86cd6edbeb148f8edd..0a9305baa0425f3173072da0d3ed16609c5b5faa 100644 (file)
@@ -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]);
+       
        
 
 }
index 5d2e2941b0fcfa1e305d24dd97f07d5bcaa6ce8e..4a251079c787e37a1d2ba3772a0198dc429d93df 100644 (file)
@@ -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 "<<greylevel[i]<<" "<< value[i]<<std::endl;
+               std::cout<<"TransferFunctionView::Process()transfer function "<<greylevel[i]<<" "<< value[i]<<std::endl;
        }
        _ctfun->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 "<<greylevelcolors[i]<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
+       std::cout<<"TransferFunctionView::Process()transfer color function "<<greylevelcolors[i]<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
        }               
 
        bbSignalOutputModification();
@@ -121,7 +121,8 @@ void TransferFunctionView::bbUserSetDefaultValues()
        void TransferFunctionView::bbUserInitializeProcessing()
        {
                _tfun = vtkPiecewiseFunction::New();
-               _ctfun = vtkColorTransferFunction::New();   
+               _ctfun = vtkColorTransferFunction::New();  
+               _ctfun->SetClamping(-1);
                bbSetInputIn(NULL);
        }
        
index 435655ffb7853cd375eca3c8df2114d8819f328a..dcb478c6fffb92f570b8c12bb185e1f1fd4d76c7 100644 (file)
@@ -115,7 +115,12 @@ void ViewerNV::Process()
             mwxwidget->setWindowLevel(bbGetInputWindowLevel());
                }
                if(bbGetInputColorLevel()!=-1){
-            mwxwidget->setColorLevel(bbGetInputColorLevel());
+                       if(bbGetInputColorLevel() == 0){
+                               std::cout<<"colorlevel "<<bbGetInputColorLevel()<<std::endl;
+                               mwxwidget->setColorLevel(0.1);
+                       }else{
+                               mwxwidget->setColorLevel(bbGetInputColorLevel());
+                       }
                }
        }       
 }
index 017c99b54139adac5153eac6c70bec2809ae575a..16fbe5306bd22df524e19c2557fb0b3bafa9a5ae 100644 (file)
@@ -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 "")
index 1182ea541fe95a1cc270e1ad20e18cf57bd4041e..b3b3a69235f54ac2578b9348c05cb41a123473d7 100644 (file)
@@ -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 (file)
index 97e02a3..0000000
+++ /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:: "<<id<<std::endl;
-               std::cout<<"vectordataid in CutModelManager:: "<<_vectordata[i]->getId()<<std::endl;
-
-               if(_vectordata[i]->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
index 3158ef9e6808dd866eb7bd079373f9998e73bd5b..3b279a75b6c41453c6cbe4159fc76678eec96eb6 100644 (file)
@@ -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
index 6b881ece3b840f101b894c17b4b0b7ee89f3ef48..4fac4e732095e973682cbda9aa46ca854add40ac 100644 (file)
@@ -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
index 8f2175d217d5eca3a74157a5f4fcb5020f2d63f6..06ceb98bd4eadadd5ec801ba93928c15818ec8cb 100644 (file)
@@ -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::vector<do
 /**
 **     Check if the variables are setted correctly
 **/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant(){
-
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *){
+       if(!_compositeFunction){
+               throw "No composite function initialized";
+       }
+       if(!_MIPFunction){
+               throw "No MIP function initialized";
+       }
+       if(!_volumeMapper){
+               throw "No volume mapper initialized";
+       }
 }
 
 /**
@@ -121,3 +131,12 @@ void wxMaracasMultipleVolumeRendererManagerData::setDataname(std::string datanam
        _dataname = dataname;
 }
 
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *){
+       checkInvariant();
+       if(function == 0){
+               _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+       }else{
+               _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
+       }
+       
+}
index 3494bfb4ff90b497177652d39b0c4f466f091fc8..0f395511e15415e686da4bede4f02783db6d6d66 100644 (file)
@@ -11,6 +11,7 @@
 #include <vtkImageData.h>
 #include <vtkProp3D.h>
 #include <vtkRenderer.h>
+#include <vtkVolumeRayCastMIPFunction.h>
 
 #include <vector>
 
@@ -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;
 
        
 };
index bbbd73bb962a0e6492e5b717e83fd37a1daae82d..d509fd9f42f8fbb65f60398006d095f494639570 100644 (file)
@@ -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
+}
+
index 44ee843a9f16d8dd3d97ec00b5543bea1ccb2d64..9bebed2a71e7dd9b153f919a58e8c0fe159d2af1 100644 (file)
@@ -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;
index 56b3015d74915269b8736916bcbc55a0eaf60d85..dc3ee24af95088b0b22099c955a05040fe8a3587 100644 (file)
@@ -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);
 }
index 6c3f5969bf34007db62fa647a453f1d5fc59c0a9..09cb5296cdc6dbff2804976f9ebb7c410620611c 100644 (file)
@@ -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<vtkImageData*> GetOutputImages();
 
+       void changeCompositeMIPFunction(int id, int function);
+
 private:
        static wxMaracasMultipleVolumeRendererView* instance;