vtkLinearTransform* transform = bbGetInputTransform();
if(img != NULL){
- imageactor = vtkImageActor::New();
- vtkImageShiftScale *imageshiftscale = vtkImageShiftScale::New();
+
imageshiftscale->SetInput( img );
imageshiftscale->SetOutputScalarTypeToUnsignedChar();
imageactor->SetInput( imageshiftscale->GetOutput() );
//-----------------------------------------------------------------
void ImageActor::bbUserInitializeProcessing()
{
+ imageactor = vtkImageActor::New();
+ imageshiftscale = vtkImageShiftScale::New();
}
//-----------------------------------------------------------------
#include <vtkRenderer.h>
#include <vtkTransform.h>
#include <vtkLinearTransform.h>
+#include <vtkImageShiftScale.h>
namespace bbcreaMaracasVisu
void Process();
bool firsttime;
vtkImageActor *imageactor;
+ vtkImageShiftScale *imageshiftscale;
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageActor,bbtk::AtomicBlackBox);
//-----------------------------------------------------
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);
}
//-----------------------------------------------------------------
}
*/
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
}
+ 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;
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();
/*