}
}
}
+
+ bbSetOutputImageFiles( view->getFiles() );
+
}
void RenderingViewer::CreateWidget(wxWindow* parent)
{
wxMaracasRendererView* surrend = wxMaracasRendererView::getInstance(parent);
bbSetOutputWidget(surrend);
-
}
void RenderingViewer::bbUserSetDefaultValues()
{
BBTK_DECLARE_OUTPUT(Out2,vtkImageData*);
BBTK_DECLARE_OUTPUT(Out3,vtkImageData*);
BBTK_DECLARE_OUTPUT(Out4,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(ImageFiles, std::vector<std::string>);
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_OUTPUT(RenderingViewer,Out2,"Output resulting image",vtkImageData*,"");
BBTK_OUTPUT(RenderingViewer,Out3,"Output resulting image",vtkImageData*,"");
BBTK_OUTPUT(RenderingViewer,Out4,"Output resulting image",vtkImageData*,"");
+BBTK_OUTPUT(RenderingViewer,ImageFiles,"File Name", std::vector<std::string>,"");
BBTK_END_DESCRIBE_BLACK_BOX(RenderingViewer);
}
// EO namespace bbcreaMaracasVisu
wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
: wxDialog(parent, -1, _T("Image Position Parameters"), wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE)
{
- vol = _vol;
- surface1 = _surface1;
- surface2 = _surface2;
- surface3 = _surface3;
-
- propID = id;
-
- transformV = vtkTransform::New();
- //vtkMatrix4x4 *_matrixV = vtkMatrix4x4::New();
- //_matrixV->Identity();
- //transformV->SetMatrix(_matrixV);
- //transformV->SetInput(vol->getViewData(propID)->getProp3D()->GetUserTransform());
-
- transformS1 = vtkTransform::New();
- //vtkMatrix4x4 *_matrixS1 = vtkMatrix4x4::New();
- //_matrixS1->Identity();
- //transformS1->SetMatrix(_matrixS1);
- //transformS1->SetInput(surface1->getViewData(propID)->getProp3D()->GetUserTransform());
-
- transformS2 = vtkTransform::New();
- //vtkMatrix4x4 *_matrixS2 = vtkMatrix4x4::New();
- //_matrixS2->Identity();
- //transformS2->SetMatrix(_matrixS2);
- //transformS2->SetInput(surface2->getViewData(propID)->getProp3D()->GetUserTransform());
-
- transformS3 = vtkTransform::New();
- //vtkMatrix4x4 *_matrixS3 = vtkMatrix4x4::New();
- //_matrixS3->Identity();
- //transformS3->SetMatrix(_matrixS3);
- //transformS3->SetInput(surface3->getViewData(propID)->getProp3D()->GetUserTransform());
-
+ wxtrasform = new wxMaracasRenderImageTransformation(_vol, _surface1, _surface2, _surface3, id);
createControls();
}
**/
void wxMaracasRenderImageManagementPanel::Translate(wxCommandEvent& event)
{
- printf("silder translateX = %d \n", sliderTranslateX->GetValue());
- transformV->Identity();
- transformS1->Identity();
- transformS2->Identity();
- transformS3->Identity();
-
- transformV->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
- transformS1->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
- transformS2->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
- transformS3->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
-
- Refresh();
+ printf("wxMaracasRenderImageManagementPanel::Translate translateX = %d \n", sliderTranslateX->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Translate translatey = %d \n", sliderTranslateY->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Translate translatez = %d \n", sliderTranslateZ->GetValue());
+ try{
+ wxtrasform->Translate(sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue());
+ }
+ catch(char* str){
+ std::cout << "Exception : " << str << '\n';
+ wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
+ diag->ShowModal();
+ }
}
/**
**/
void wxMaracasRenderImageManagementPanel::Rotate(wxCommandEvent& event)
{
- printf("silder rotateX = %d \n", sliderRotateX->GetValue());
-
- transformV->Identity();
- transformS1->Identity();
- transformS2->Identity();
- transformS3->Identity();
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderRotateX->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
- transformS1->RotateX( sliderRotateX->GetValue() );
- transformS2->RotateX( sliderRotateX->GetValue() );
- transformS3->RotateX( sliderRotateX->GetValue() );
-
- transformV->RotateY( sliderRotateY->GetValue() );
- transformS1->RotateY( sliderRotateY->GetValue() );
- transformS2->RotateY( sliderRotateY->GetValue() );
- transformS3->RotateY( sliderRotateY->GetValue() );
-
- transformV->RotateZ( sliderRotateZ->GetValue() );
- transformS1->RotateZ( sliderRotateZ->GetValue() );
- transformS2->RotateZ( sliderRotateZ->GetValue() );
- transformS3->RotateZ( sliderRotateZ->GetValue() );
-
- Refresh();
+ try{
+ wxtrasform->Rotate( sliderRotateX->GetValue(), sliderRotateY->GetValue(), sliderRotateZ->GetValue() );
+ }
+ catch(char* str){
+ std::cout << "Exception : " << str << '\n';
+ wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
+ diag->ShowModal();
+ }
}
/**
**/
void wxMaracasRenderImageManagementPanel::Scale(wxCommandEvent& event)
{
- transformV->Identity();
- transformS1->Identity();
- transformS2->Identity();
- transformS3->Identity();
-
- transformV->Scale( sliderTranslateX->GetValue()/50, sliderTranslateY->GetValue()/50, sliderTranslateZ->GetValue()/50 );
- transformS1->Scale( sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue() );
- transformS2->Scale( sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue() );
- transformS3->Scale( sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue() );
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderScaleX->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
+ printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
- Refresh();
-}
-
-void wxMaracasRenderImageManagementPanel::Refresh()
-{
try{
- transformV->Update();
- transformS1->Update();
- transformS2->Update();
- transformS3->Update();
-
- vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
- surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+ wxtrasform->Scale( sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue() );
}
- catch(char* str)
- {
+ catch(char* str){
std::cout << "Exception : " << str << '\n';
wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
diag->ShowModal();
#ifndef wxMaracasRenderImageManagementPanel_H_
#define wxMaracasRenderImageManagementPanel_H_
-#include <vtkTransform.h>
-#include <vtkProp3D.h>
-
-#include "wxMaracasMultipleVolumeRendererManager.h"
-#include "wxMaracasSurfaceRenderingManager.h"
+#include "wxMaracasRenderImageTransformation.h"
#include <wx/wx.h>
void Rotate(wxCommandEvent& event);
void Scale(wxCommandEvent& event);
- void Refresh();
-
private:
wxSlider* sliderTranslateX;
wxSlider* sliderScaleY;
wxSlider* sliderScaleZ;
- //wxMaracasRenderTabbedPanel* wxtbbpanel;
- wxMaracasMultipleVolumeRendererManager* vol;
- wxMaracasSurfaceRenderingManager* surface1;
- wxMaracasSurfaceRenderingManager* surface2;
- wxMaracasSurfaceRenderingManager* surface3;
-
- vtkTransform* transformV;
- vtkTransform* transformS1;
- vtkTransform* transformS2;
- vtkTransform* transformS3;
-
- int propID;
+ wxMaracasRenderImageTransformation* wxtrasform;
};
#endif
\ No newline at end of file
--- /dev/null
+
+#include "wxMaracasRenderImageTransformation.h"
+
+/**
+** Class constructor
+**/
+wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracasMultipleVolumeRendererManager* _vol, wxMaracasSurfaceRenderingManager* _surface1,
+ wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
+{
+ vol = _vol;
+ surface1 = _surface1;
+ surface2 = _surface2;
+ surface3 = _surface3;
+
+ propID = id;
+
+ transformV = vtkTransform::New();
+ transformS1 = vtkTransform::New();
+ transformS2 = vtkTransform::New();
+ transformS3 = vtkTransform::New();
+
+}
+
+/**
+** Class destructor
+**/
+wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
+{
+}
+
+/**
+** Transforms a volume by the given value for the X axis
+**/
+void wxMaracasRenderImageTransformation::Translate(int x, int y, int z)
+{
+ transformV->Identity();
+ transformS1->Identity();
+ transformS2->Identity();
+ transformS3->Identity();
+
+ transformV->Translate( x, y, z );
+ transformS1->Translate( x, y, z );
+ transformS2->Translate( x, y, z );
+ transformS3->Translate( x, y, z );
+
+ Refresh();
+}
+
+/**
+** Rotates a volume by the given degree for the X axis
+**/
+void wxMaracasRenderImageTransformation::Rotate(int x, int y, int z)
+{
+ transformV->Identity();
+ transformS1->Identity();
+ transformS2->Identity();
+ transformS3->Identity();
+
+ transformV->RotateX( x );
+ transformS1->RotateX( x );
+ transformS2->RotateX( x );
+ transformS3->RotateX( x );
+
+ transformV->RotateY( y );
+ transformS1->RotateY( y );
+ transformS2->RotateY( y );
+ transformS3->RotateY( y );
+
+ transformV->RotateZ( z );
+ transformS1->RotateZ( z );
+ transformS2->RotateZ( z );
+ transformS3->RotateZ( z );
+
+ Refresh();
+}
+
+/**
+** Scales a volume by the given value for the X axis
+**/
+void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
+{
+ transformV->Identity();
+ transformS1->Identity();
+ transformS2->Identity();
+ transformS3->Identity();
+
+ transformV->Scale( x, y, z );
+ transformS1->Scale( x, y, z );
+ transformS2->Scale( x, y, z );
+ transformS3->Scale( x, y, z );
+
+ Refresh();
+}
+
+void wxMaracasRenderImageTransformation::Refresh()throw(char*)
+{
+ transformV->Update();
+ transformS1->Update();
+ transformS2->Update();
+ transformS3->Update();
+
+ vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+ vol->getRenderer()->Render();
+
+ surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+ surface1->getRenderer()->Render();
+
+ surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+ surface2->getRenderer()->Render();
+
+ surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+ surface3->getRenderer()->Render();
+}
\ No newline at end of file
--- /dev/null
+#ifndef wxMaracasRenderImageTransformation_H_
+#define wxMaracasRenderImageTransformation_H_
+
+#include <vtkTransform.h>
+
+#include "wxMaracasMultipleVolumeRendererManager.h"
+#include "wxMaracasSurfaceRenderingManager.h"
+
+class wxMaracasRenderImageTransformation
+{
+public:
+
+ wxMaracasRenderImageTransformation(wxMaracasMultipleVolumeRendererManager* vol, wxMaracasSurfaceRenderingManager* surface1,
+ wxMaracasSurfaceRenderingManager* surface2, wxMaracasSurfaceRenderingManager* surface3, int id);
+ ~wxMaracasRenderImageTransformation();
+
+ void Translate(int x, int y, int z);
+ void Rotate(int x, int y, int z);
+ void Scale(int x, int y, int z);
+
+ void Refresh()throw(char*);
+
+private:
+ wxMaracasMultipleVolumeRendererManager* vol;
+ wxMaracasSurfaceRenderingManager* surface1;
+ wxMaracasSurfaceRenderingManager* surface2;
+ wxMaracasSurfaceRenderingManager* surface3;
+
+ vtkTransform* transformV;
+ vtkTransform* transformS1;
+ vtkTransform* transformS2;
+ vtkTransform* transformS3;
+
+ int propID;
+};
+
+#endif
\ No newline at end of file
if(fildial->ShowModal()==wxID_OK)
{
wxString filename = fildial->GetFilename();
+ files.push_back( std::string(filename.mb_str()) );
wxString pathfile(fildial->GetDirectory() + _T("/") + filename);
+
if(filename.EndsWith(mhd))
{
std::string sPath = std::string(pathfile.mb_str());
//wxtabs->addRemoveActorSC(id, addremove);
}
+/**
+** Gets opened file names
+**/
+std::vector<std::string> wxMaracasRendererView::getFiles()
+{
+ return files;
+}
+
/**
**
**/
void addRemoveSurf1Actor(int id, bool addremove);
void addRemoveSurf2Actor(int id, bool addremove);
void addRemoveSurf3Actor(int id, bool addremove);
-
-
- //void SetValuesColorPointsFunction(int volid, std::vector<double> greylevelcolors,std::vector<double> red,std::vector<double> green,std::vector<double> blue);
- //void SetValuesPointsFunction(int volid, std::vector<double> greylevel, std::vector<double> values);
-
- //vtkPiecewiseFunction* GetTransferFunction(int volumeid);
- //vtkColorTransferFunction* GetColorFunction(int volumeid);
+ std::vector<std::string> getFiles();
+
private:
static wxMaracasRendererView* instance;
std::vector<wxMaracasRenderTabbedPanel*> tabsVector;
- wxAuiManager* wxauimanager;
- vtkRenderer* _renderer;
+ std::vector<std::string> files;
- std::string _path;
+ wxAuiManager* wxauimanager;
wxToolBar * _toolb;
+ vtkRenderer* _renderer;
+ std::string _path;
};
class ToolBarEventHandlerRenderer : public wxEvtHandler
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRendering.cxx,v $
Language: C++
- Date: $Date: 2009/11/09 19:14:56 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/11/13 09:34:10 $
+ Version: $Revision: 1.5 $
Copyright: (c) 2002, 2003
License:
wxString filename = fildial->GetFilename();
wxString pathfile(fildial->GetDirectory() + _T("/") + filename);
-
if(filename.EndsWith(mhd))
{
loadPropMHD(pathfile,filename);
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRendering.h,v $
Language: C++
- Date: $Date: 2009/10/15 11:56:43 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/11/13 09:34:10 $
+ Version: $Revision: 1.2 $
Copyright: (c) 2002, 2003
License:
static wxMaracasSurfaceRendering* instance;
wxMaracasSurfaceRenderingManager* surrendmanager;
-
wxAuiManager* wxauimanager;
-
- void createFileChooser();
+ wxToolBar* _toolb;
std::string _path;
- wxToolBar* _toolb;
+ void createFileChooser();
+
};
Program: wxMaracas
Module: $RCSfile: wxMaracasSurfaceRenderingManager.cxx,v $
Language: C++
- Date: $Date: 2009/11/09 19:14:56 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/11/13 09:34:10 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
return -1;
}
int wxMaracasSurfaceRenderingManager::addPropMHD(vtkImageData* imagedata, std::string dataname) throw(char*){
-
checkInvariant();
if(imagedata != NULL){
image = imagedata;
}
_renderer->Render();
}
-
}
/**
** Changes the opacity in a prop3D