]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 2 Jul 2009 07:17:14 +0000 (07:17 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 2 Jul 2009 07:17:14 +0000 (07:17 +0000)
bbtk/src/bbmaracasvisuImageActor.cxx
bbtk/src/bbmaracasvisuImageActor.h
bbtk/src/bbmaracasvisuTransferFunctionView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h

index f95af03aa17cadf31ee64cceec722a46dcd10d8e..3d54751919513861682490cd1b3327f3ccd2da4b 100644 (file)
@@ -17,8 +17,7 @@ void ImageActor::Process()
                vtkLinearTransform* transform   = bbGetInputTransform();
 
                if(img != NULL){
-                       imageactor = vtkImageActor::New();
-                       vtkImageShiftScale *imageshiftscale = vtkImageShiftScale::New();
+                       
                        imageshiftscale->SetInput( img );       
                        imageshiftscale->SetOutputScalarTypeToUnsignedChar();   
                        imageactor->SetInput( imageshiftscale->GetOutput() );   
@@ -57,6 +56,8 @@ void ImageActor::bbUserSetDefaultValues()
        //-----------------------------------------------------------------     
        void ImageActor::bbUserInitializeProcessing()
        {
+               imageactor = vtkImageActor::New();
+               imageshiftscale = vtkImageShiftScale::New();
        }
        
        //-----------------------------------------------------------------     
index 908b5de17c00e72241431b383f9e608576999b52..73a936ac251b61e5f68a096d72cb662df633d229 100644 (file)
@@ -10,6 +10,7 @@
 #include <vtkRenderer.h>
 #include <vtkTransform.h>
 #include <vtkLinearTransform.h>
+#include <vtkImageShiftScale.h>
 
 
 namespace bbcreaMaracasVisu
@@ -28,6 +29,7 @@ class bbcreaMaracasVisu_EXPORT ImageActor
   void Process();
   bool firsttime;
   vtkImageActor *imageactor;
+  vtkImageShiftScale *imageshiftscale;
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageActor,bbtk::AtomicBlackBox);
index 0693ec168a23f3cd8970f2a52968e642e67bcca1..f95262df8dfc5aeea3d6a8e3df77254a50ae65ca 100644 (file)
@@ -9,27 +9,37 @@ BBTK_BLACK_BOX_IMPLEMENTATION(TransferFunctionView,bbtk::WxBlackBox);
 //-----------------------------------------------------
 void TransferFunctionView::Process()
 {
+       if(bbGetInputIn()!=NULL){
+               mwxwidget->initializeHistogram(bbGetInputIn()); 
+               mwxwidget->Refresh();
+       }
+       
+       
+
 }
 
 //-----------------------------------------------------
 void TransferFunctionView::CreateWidget(wxWindow* parent)
 {
        bbtkDebugMessageInc("Core",9,"TransferFunctionView::CreateWxWindow()"<<std::endl);
-       mwxwidget = new HistogramWidget(parent, -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER ,bbGetInputIn(),1);
+
+       mwxwidget = new HistogramWidget(parent, -1);
     bbtkDebugDecTab("Core",9);
-       bbSetOutputWidget( mwxwidget );
+       bbSetOutputWidget( mwxwidget ); 
 }
 
 //-----------------------------------------------------
 void TransferFunctionView::bbUserSetDefaultValues()
 {
        mwxwidget = NULL;
+
 }
 
        
        //-----------------------------------------------------------------     
        void TransferFunctionView::bbUserInitializeProcessing()
        {
+               bbSetInputIn(NULL);
        }
        
        //-----------------------------------------------------------------     
index affe13c876cbe3c28c0a631115771bc2ce2acfc8..d5dd0d772b6a63f7b31143de3cbbc4291242840c 100644 (file)
@@ -41,7 +41,7 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint
        }
  */
        HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData,int type):
-       wxPanel(parent,id,pos,size,flag)
+       wxPanel(parent,id,pos,size)
        {
                 SetBackgroundColour(wxColour(255,255,255));
                //histogram
@@ -67,6 +67,39 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint
                
        }
 
+       HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id)
+               : wxPanel(parent,id){
+
+
+                       SetBackgroundColour(wxColour(255,255,255));
+                       histogram = NULL;       
+                       
+                       //plotter
+                       plotter=new pPlotter(this, 400,350);
+
+                       //is a plotter of histograms
+                       plotter->setType(2);
+                       //setting the popMenu
+                       plotter->setPopUpMenu(true,true,true,true,true,true,false,false,false,false,false,false,false);
+                       histogramSize=0;
+                       idTransferenceFunction=-1;
+                       idHistogram=-1;
+                       transferenceFunctionHasColor=true;
+                       transferenceFunctionHasPoints=true;
+                       this->type=type;;
+               
+                               
+       }
+
+       void HistogramWidget::initializeHistogram(vtkImageData* img){
+               if(histogram ==NULL){
+                       histogram= new pHistogram(img);
+               }               
+               //draw
+               drawHistogram();
+               drawTransferenceFunction();
+       }
+
        HistogramWidget::~HistogramWidget()
        {
                delete histogram;
index f559cc47c7a1d8ba6e9ff5c05e4178e714976a83..7b48d59f6a317fe33be226db9582d475e07675cc 100644 (file)
@@ -39,7 +39,9 @@ public:
        
  
        HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData,int type);
-       
+
+       HistogramWidget( wxWindow *parent, wxWindowID id);
+       void initializeHistogram(vtkImageData* img);
        ~HistogramWidget();
 
        /*