X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FHistogram.cxx;h=459cc18a40b73ffb2f507ab48a7325824642900e;hb=80b04dc9e3b981e24fe9ae0d81cdeb8af6e6f8c1;hp=d9134e4fca6b9df7db1f0aaff8db3cead9758af1;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx index d9134e4..459cc18 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx @@ -95,7 +95,7 @@ END_EVENT_TABLE() } - void Histogram::Configure(vtkImageData* imageData) + void Histogram::Configure(vtkImageData* imageData) { histogram= new pHistogram(imageData); drawHistogram(); @@ -119,13 +119,19 @@ END_EVENT_TABLE() 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); @@ -160,6 +166,7 @@ END_EVENT_TABLE() int scrX,scrY; GetClientSize(&scrX,&scrY); plotter->SetSize(scrX,scrY); + /* pGraphicalFunction* actual=plotter->getFunction(idTransferenceFunction); actual->setScreens(scrX,scrY); @@ -186,4 +193,15 @@ END_EVENT_TABLE() return histogramSize; } + wxWindow* Histogram::GetWindow() + { + return this; + } + + pPlotterWindow* Histogram::GetPlotterWindow() + { + return plotter; + } + +