}
- void Histogram::Configure(vtkImageData* imageData)
+ void Histogram::Configure(vtkImageData* imageData)
{
histogram= new pHistogram(imageData);
drawHistogram();
xValues=(double*)malloc(NUM_POINTS*sizeof(double));
yValues=(double*)malloc(NUM_POINTS*sizeof(double));
- unsigned short* histogramPointer=(unsigned short*)histogramImageData->GetScalarPointer(0,0,0);
+ double* histogramPointer=(double*)histogramImageData->GetScalarPointer(0,0,0);
- for(int i=0; i< histogramSize; i++)
+ int i;
+ for(i=0; i< histogramSize; i++)
{
xValues[i]=i;
- yValues[i]=log( (double) histogramPointer[i])*10;
- }
+ if (histogramPointer[i]==0)
+ {
+ yValues[i]=0;
+ } else {
+ yValues[i]=log(histogramPointer[i])*10;
+ } // if histogramPointer
+ } // for i
pGraphicalFunction* histogramFunction=plotter->getFunctionForVectors(xValues,histogramSize,yValues,histogramSize);
int scrX,scrY;
GetClientSize(&scrX,&scrY);
plotter->SetSize(scrX,scrY);
+
/*
pGraphicalFunction* actual=plotter->getFunction(idTransferenceFunction);
actual->setScreens(scrX,scrY);
return histogramSize;
}
+ wxWindow* Histogram::GetWindow()
+ {
+ return this;
+ }
+
+ pPlotterWindow* Histogram::GetPlotterWindow()
+ {
+ return plotter;
+ }
+
+