Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:13 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2008/12/03 09:34:37 $
+ Version: $Revision: 1.30 $
=========================================================================*/
/* ---------------------------------------------------------------------
{
bbtkDebugMessage("modified",2,"-> Status set to modified"<<std::endl);
this->bbSetStatus(MODIFIED);
+ std::cout << "Status set to modified" <<std::endl;
}
this->bbSignalOutputModification(false);
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/11/13 14:46:43 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/12/03 09:34:37 $
+ Version: $Revision: 1.15 $
=========================================================================*/
/* ---------------------------------------------------------------------
virtual void bbUserOnShow() { }
void bbUserOnShowWidget(std::string nameInput);
-
protected:
//==================================================================
// PROTECTED PART : ACCESSIBLE TO THE BlackBox DEVELOPER
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.cxx,v $
Language: C++
- Date: $Date: 2008/11/27 16:38:32 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2008/12/03 09:34:39 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbvtkPackage.h"
#include "vtkCellPicker.h"
#include "vtkProperty.h"
+#include "vtkMetaImageWriter.h"
#include "bbstdCast.h"
namespace bbstd
std::vector<double> vect;
vect.push_back(512);
vect.push_back(256);
- bbSetInputWindowLevel (vect);
+ bbSetInputWindowLevel (vect);
+
+ bbSetModifiedStatus();
}
void ImagePlanes::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
}
void ImagePlanes::Init()
- {
-
+ {
if (planeWidgetX != 0) return;
+
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
vtkCellPicker* picker = vtkCellPicker::New();
bbSetOutputPlaneZ(planeWidgetZ);
picker->UnRegister(NULL);
+
+ myCallbackPlane *_myCallback = myCallbackPlane::New();
+ _myCallback->SetCurrentBlackBox(this);
+ planeWidgetX->AddObserver(vtkCommand::InteractionEvent,_myCallback);
+ planeWidgetY->AddObserver(vtkCommand::InteractionEvent,_myCallback);
+ planeWidgetZ->AddObserver(vtkCommand::InteractionEvent,_myCallback);
}
//---------------------------------------------------------------------
planeWidgetX->SetSlicePosition((xMax+xMin)/2.*xSpacing);
planeWidgetX->GetResliceOutput()->Update();
bbSetOutput("ImageX", planeWidgetX->GetResliceOutput());
+
+
+ vtkMetaImageWriter *writer = vtkMetaImageWriter::New();
+
+ std::string newFilenameX("newFilenameX.mhd");
+ writer->SetInput(planeWidgetX->GetResliceOutput());
+ writer->SetFileName(newFilenameX.c_str());
+ writer->Update();
+
//planeWidgetX->GetResliceOutput()->Print(std::cout);
planeWidgetY->SetInput(bbGetInputIn());
bbSetOutput("ImageY", planeWidgetY->GetResliceOutput());
//planeWidgetY->GetResliceOutput()->Print(std::cout);
+ std::string newFilenameY("newFilenameY.mhd");
+ writer->SetInput(planeWidgetY->GetResliceOutput());
+ writer->SetFileName(newFilenameY.c_str());
+ writer->Update();
+
planeWidgetZ->SetInput(bbGetInputIn());
planeWidgetZ->SetPlaneOrientationToZAxes();
planeWidgetZ->SetSlicePosition((zMax+zMin)/2.*zSpacing);
// planeWidgetZ->GetResliceOutput()->Print(std::cout);
// planeWidgetZ->SetWindowLevel(512,256);
-
+
+ std::string newFilenameZ("newFilenameZ.mhd");
+ writer->SetInput(planeWidgetZ->GetResliceOutput());
+ writer->SetFileName(newFilenameZ.c_str());
+ writer->Update();
+
planeWidgetZ->SetWindowLevel(bbGetInputWindowLevel()[0],bbGetInputWindowLevel()[1]);
+
+ // writer->vtkMetaImageWriter::Delete();
+
}
}
}//namespace bbtk
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.h,v $
Language: C++
- Date: $Date: 2008/11/27 14:57:38 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/12/03 09:34:39 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
//#include "vtkRenderer.h"
//#include "vtkCamera.h"
+#include <vtkCommand.h>
+#include "vtkPlaneWidget.h"
+
namespace bbvtk
{
+ class myCallbackPlane : public vtkCommand
+ {
+ public:
+ static myCallbackPlane *New()
+ {
+ return new myCallbackPlane;
+ }
+ virtual void Execute(vtkObject *caller, unsigned long, void*)
+ {
+ std::cout << "entree ds myCallbackPlane::Execute()" << std::endl;
+ printf("Execute Call Back on %p\n",caller);
+
+ currentBlackBox->bbSetModifiedStatus();
+ }
+ void SetCurrentBlackBox(bbtk::AtomicBlackBox *cBB) {currentBlackBox = cBB;};
+ void SetVtkPlaneWidget( vtkImagePlaneWidget *planeWidget );
+ myCallbackPlane()
+ {
+ // std::cout << "entree Constr myCallbackPlane" << std::endl;
+ };
+
+ private:
+ vtkPlaneWidget *planeWidget;
+ bbtk::AtomicBlackBox *currentBlackBox;
+ };
}//namespace bbvtk
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/11/29 21:42:01 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2008/12/03 09:34:41 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
backImageData = mDefaultImage;
mUpdateCamera = true;
+ std::cout << "Viewer2DWidget::UpdateView() passe par 1" << std::endl;
}
else if ( ( mBox->bbGetInputIn() != NULL ) &&
(backImageData != mBox->bbGetInputIn()) )
backImageData->Update();
imageViewer->SetInput( backImageData );
mUpdateCamera = true;
+ std::cout << "Viewer2DWidget::UpdateView() passe par 2" << std::endl;
}
if (mUpdateCamera)
//
// imageViewer->GetRenderer()->ResetCamera(x1,x2,y1,y2,z1,z2);
mUpdateCamera = false;
+ std::cout << "Viewer2DWidget::UpdateView() passe par 3" << std::endl;
}
// std::cout << "OW = "<< mBox->bbGetWindow() << std::endl;
imageViewer->SetSliceOrientation (orientation);
imageViewer->SetSlice( z );
-
+std::cout << "Viewer2DWidget::UpdateView() passe par 4" << std::endl;
/*
#if (VTK_MAJOR_VERSION >= 5)
imageViewer->SetSlice( z );
// (see wxvtk/bbs/appli/ExampleSimpleSlicer)
// I think there is a problem with rendering before window
// has been reparented ... we have to check this
+
+std::cout << "Viewer2D::Process() passe par 5" << std::endl;
+
Viewer2DWidget* w = (Viewer2DWidget*)bbGetOutputWidget();
+
if (w)
{
+std::cout << "Viewer2D::Process() passe par 6" << std::endl;
w->UpdateView();
bbSetOutputRenderer( ((Viewer2DWidget*)bbGetOutputWidget())->GetRenderer() );
}
*/
void Viewer2D::CreateWidget(wxWindow* parent)
{
+ std::cout << "Viewer2D::CreateWidget() passe par 7" << std::endl;
Viewer2DWidget* w = new Viewer2DWidget(this,parent);//bbGetWxParent());
+
bbSetOutputWidget(w);
}