void HistogramView::Process()
{
printf("EED HistogramView::Process Start \n");
- if (firsttime==true){
+ if (firsttime==true)
+ {
firsttime=false;
// histogram_wxwidget = new Histogram( wxpanel , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER );
- histogram_wxwidget->Configure( bbGetInputIn() );
+ _histogramMinMaxLevel->Configure( bbGetInputIn() );
}
printf("EED HistogramView::Process End \n");
}
// histogram_wxwidget = new Histogram( parent , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER ,bbGetInputIn());
wxPanel *wxpanel =new wxPanel(parent);
wxpanel->SetSize(400,400);
- histogram_wxwidget = new Histogram( parent , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER );
+
+//Borrame
+// histogram_wxwidget = new Histogram( parent , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER );
- bbtkDebugDecTab("Core",9);
- bbSetOutputWidget( histogram_wxwidget );
+ Histogram* histogram = new Histogram( parent , -1, wxPoint(0,0), wxSize(400,400), /*wxNO_BORDER*/ wxBORDER_DEFAULT );
+ _histogramMinMaxLevel = new HistogramMinMaxLevel( (HistogramBase*)histogram );
+
+ bbtkDebugDecTab("Core",9);
+ bbSetOutputWidget( _histogramMinMaxLevel->GetWindow() );
// bbSetOutputWidget( wxpanel );
}
#include "vtkImageData.h"
#include "Histogram.h"
+#include "HistogramBase.h"
namespace bbcreaMaracasVisu
void CreateWidget(wxWindow*);
private:
- bool firsttime;
- Histogram *histogram_wxwidget;
- wxPanel *wxpanel;
+ bool firsttime;
+ HistogramMinMaxLevel* _histogramMinMaxLevel;
+ wxPanel* wxpanel;
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(HistogramView,bbtk::WxBlackBox);
-BBTK_NAME("HistogramView");
-BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("Histogram window");
-BBTK_CATEGORY("viewer");
+ BBTK_NAME("HistogramView");
+ BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
+ BBTK_DESCRIPTION("Histogram window");
+ BBTK_CATEGORY("viewer");
BBTK_INPUT(HistogramView,In,"Input image",vtkImageData*,"");
BBTK_END_DESCRIBE_BLACK_BOX(HistogramView);
}
* \brief
*/
-#ifndef __ThresholdImageViewPanel_h__
-#define __ThresholdImageViewPanel_h__
+#ifndef __mBarRange2_h__
+#define __mBarRange2_h__
#include <wx/wx.h>
};
-#endif
+#endif //__mBarRange2_h__
*/
pFigure :: pFigure(int edges_n, int _w, int _h, int _orientation, bool bar_orientation)
{
- edges = edges_n;
+ edges = edges_n;
orientation = _orientation;
- width = _w;
- heigth = _h;
+ width = _w;
+ heigth = _h;
setBarOrientation( bar_orientation );
}
points = vtkImageData::New();
size = 100;
sizeImage = 0;
- //cast
- /*
- vtkImageCast* cast= vtkImageCast::New();
- cast->SetInput(imageData);
- cast->SetOutputScalarTypeToInt();
- cast->Update();
- */
- //build the histogram
buildHistogram(imageData);
}
unsigned short* dataImagePointerUS = (unsigned short*)imageData->GetScalarPointer(0,0,0);
float* dataImagePointerF = (float*)imageData->GetScalarPointer(0,0,0);
double* dataImagePointerD = (double*)imageData->GetScalarPointer(0,0,0);
-
- double* dataHistogramPointer = (double*)points->GetScalarPointer(0,0,0);
+ double* dataHistogramPointer = (double*)points->GetScalarPointer(0,0,0);
/*
Range of greys
int ext[6];
imageData->GetExtent(ext);
int sx,sy,sz;
- sx=ext[1]-ext[0]+1;
- sy=ext[3]-ext[2]+1;
- sz=ext[5]-ext[4]+1;
+ sx = ext[1]-ext[0]+1;
+ sy = ext[3]-ext[2]+1;
+ sz = ext[5]-ext[4]+1;
sizeImage=sx*sy*sz;
dataHistogramPointer[i]=0;
}
- int j=0;
+ long int j=0;
if (imageData->GetScalarType()==VTK_CHAR)
*/
int pHistogram::getIndex(double gValue)
{
-
- double p=((double)gValue-minLevelOfGrey)/(maxLevelOfGrey-minLevelOfGrey);
+ double p;
+ double diff=maxLevelOfGrey-minLevelOfGrey;
+ if (diff!=0)
+ {
+ p=((double)gValue-minLevelOfGrey)/(maxLevelOfGrey-minLevelOfGrey);
+ } else {
+ p=0;
+ }
double k=p*(size-1);
//std::cout<<"gValue "<<gValue<<" k "<<k<<std::endl;
return (int)k;