}
}
- vtkImageData* img1 = volview->GetOutputImages()[0];
+ //vtkImageData* img1 = volview->GetOutputImages()[0];
- bbSetOutputOut0(img1);
- bbSetOutputOut1(volview->GetOutputImages()[1]);
- bbSetOutputOut2(volview->GetOutputImages()[2]);
- bbSetOutputOut3(volview->GetOutputImages()[3]);
+ //bbSetOutputOut0(img1);
+ //bbSetOutputOut1(volview->GetOutputImages()[1]);
+ //bbSetOutputOut2(volview->GetOutputImages()[2]);
+ //bbSetOutputOut3(volview->GetOutputImages()[3]);
}
-
-
-
-
}
void VolumeRendering::CreateWidget(wxWindow* parent)
{
** Class constructor
**/
wxMaracasRenderImageManagementPanel::wxMaracasRenderImageManagementPanel(wxWindow* parent, wxMaracasMultipleVolumeRendererManager* _vol, wxMaracasSurfaceRenderingManager* _surface1,
- wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
-: wxDialog(parent, -1, _T("Image Position Parameters"), wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE)
+ wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, wxString title, int id)
+: wxDialog(parent, -1, title, wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE)
{
wxtrasform = new wxMaracasRenderImageTransformation(_vol, _surface1, _surface2, _surface3, id);
createControls();
//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() );
- wxtrasform->Rotate( sliderRotateX->GetValue(), sliderRotateY->GetValue(), sliderRotateZ->GetValue() );
- wxtrasform->Scale( sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue());
+ wxtrasform->Translate( sliderTranslateX->GetValue(), sliderTranslateY->GetValue(), sliderTranslateZ->GetValue(),
+ sliderRotateX->GetValue(), sliderRotateY->GetValue(), sliderRotateZ->GetValue(),
+ sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue() );
}
catch(char* str){
std::cout << "Exception : " << str << '\n';
wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
diag->ShowModal();
}
-}
-
-/**
-** Rotates a volume by the given degree for the X axis
-*
-void wxMaracasRenderImageManagementPanel::Rotate(wxCommandEvent& event)
-{
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderRotateX->GetValue());
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
-
- 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();
- }
-}*/
-
-/**
-** Scales a volume by the given value for the X axis
-*
-void wxMaracasRenderImageManagementPanel::Scale(wxCommandEvent& event)
-{
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateX = %d \n", sliderScaleX->GetValue());
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateY = %d \n", sliderRotateY->GetValue());
- //printf("wxMaracasRenderImageManagementPanel::Rotate rotateZ = %d \n", sliderRotateZ->GetValue());
-
- try{
- wxtrasform->Scale( sliderScaleX->GetValue(), sliderScaleY->GetValue(), sliderScaleZ->GetValue());
- }
- catch(char* str){
- std::cout << "Exception : " << str << '\n';
- wxMessageDialog* diag = new wxMessageDialog(this, wxString(str,wxConvUTF8 ), wxString(str,wxConvUTF8 ), wxICON_ERROR);
- diag->ShowModal();
- }
-}*/
-
+}
\ No newline at end of file
public:
wxMaracasRenderImageManagementPanel(wxWindow* parent, wxMaracasMultipleVolumeRendererManager* vol, wxMaracasSurfaceRenderingManager* surface1,
- wxMaracasSurfaceRenderingManager* surface2, wxMaracasSurfaceRenderingManager* surface3, int id);
+ wxMaracasSurfaceRenderingManager* surface2, wxMaracasSurfaceRenderingManager* surface3, wxString title, int id);
~wxMaracasRenderImageManagementPanel();
void createControls();
-
void Transform(wxCommandEvent& event);
- /*void Rotate(wxCommandEvent& event);
- void Scale(wxCommandEvent& event);*/
private:
surface2 = _surface2;
surface3 = _surface3;
- propID = id;
-
transformV = vtkTransform::New();
transformS1 = vtkTransform::New();
transformS2 = vtkTransform::New();
**/
wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
{
- transformV->Identity();
- transformS1->Identity();
- transformS2->Identity();
- transformS3->Identity();
+
}
/**
** Transforms a volume by the given value for the X axis
**/
-void wxMaracasRenderImageTransformation::Translate(int x, int y, int z)
+void wxMaracasRenderImageTransformation::Translate(int tx, int ty, int tz, int rx, int ry, int rz, int sx, int sy, int sz)
{
- transformV->Translate( x, y, z );
- transformS1->Translate( x, y, z );
- transformS2->Translate( x, y, z );
- transformS3->Translate( x, y, z );
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", tx);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", ty);
+ //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", tz);
- Refresh();
-}
+ double volspX;
+ double volspY;
+ double volspZ;
-/**
-** Rotates a volume by the given degree for the X axis
-**/
-void wxMaracasRenderImageTransformation::Rotate(int x, int y, int z)
-{
- transformV->RotateX( x );
- transformS1->RotateX( x );
- transformS2->RotateX( x );
- transformS3->RotateX( x );
+ vol->getImageData()->GetSpacing(volspX, volspY, volspZ);
+
+ double surfspX;
+ double surfspY;
+ double surfspZ;
+ surface1->getImageData()->GetSpacing(surfspX, surfspY, surfspZ);
+
+ transformV->Identity();
+ transformS1->Identity();
+ transformS2->Identity();
+ transformS3->Identity();
+
+ transformV->Translate( tx/*volspX*/, ty/*volspY*/, tz/*volspZ*/ );
+ transformS1->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+ transformS2->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+ transformS3->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+
+ transformV->RotateX( rx/*volspX*/ );
+ transformS1->RotateX( rx/*surfspX*/ );
+ transformS2->RotateX( rx/*surfspX*/ );
+ transformS3->RotateX( rx/*surfspX*/ );
- transformV->RotateY( y );
- transformS1->RotateY( y );
- transformS2->RotateY( y );
- transformS3->RotateY( y );
+ transformV->RotateY( ry/*volspY*/ );
+ transformS1->RotateY( ry/*surfspY*/ );
+ transformS2->RotateY( ry/*surfspY*/ );
+ transformS3->RotateY( ry/*surfspY*/ );
- transformV->RotateZ( z );
- transformS1->RotateZ( z );
- transformS2->RotateZ( z );
- transformS3->RotateZ( z );
+ transformV->RotateZ( rz/*volspZ*/ );
+ transformS1->RotateZ( rz/*surfspZ*/ );
+ transformS2->RotateZ( rz/*surfspZ*/ );
+ transformS3->RotateZ( rz/*surfspZ*/ );
+
+ transformV->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+ transformS1->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+ transformS2->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+ transformS3->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
Refresh();
}
+
/**
** Scales a volume by the given value for the X axis
-**/
+*
void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
{
float resultX = x/100.0;
//printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
//printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
- //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", resultX);
- //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", resultY);
- //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", resultZ);
-
- transformV->Scale( (x/100.0), (y/100.0), (z/100.0) );
- transformS1->Scale( (x/100.0), (y/100.0), (z/100.0) );
- transformS2->Scale( (x/100.0), (y/100.0), (z/100.0) );
- transformS3->Scale( (x/100.0), (y/100.0), (z/100.0) );
-
Refresh();
-}
+}*/
/**
** Updates each Matrix
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 Translate(int tx, int ty, int tz, int rx, int ry, int rz, int sx, int sy, int sz);
void Refresh()throw(char*);
private:
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
{
_id = id;
+
+ dialog = NULL;
+
volmanager = new wxMaracasMultipleVolumeRendererManager();
surrendmanager1 = new wxMaracasSurfaceRenderingManager();
surrendmanager2 = new wxMaracasSurfaceRenderingManager();
addSurface1(img, filename);
addSurface2(img, filename);
addSurface3(img, filename);
+ volname = (wxString) filename;
wxtabs->Refresh();
}
}
**
**/
void wxMaracasRenderTabbedPanel::onOpenParameters(wxCommandEvent& event){
- if(dialog == NULL){
- dialog = new wxMaracasRenderImageManagementPanel(this, volmanager, surrendmanager1, surrendmanager2, surrendmanager3, this->getPropIdV());
+ if(dialog == NULL)
+ {
+ dialog = new wxMaracasRenderImageManagementPanel(this, volmanager, surrendmanager1, surrendmanager2, surrendmanager3, volname, _id);
dialog->SetSize(400, 580);
+ dialog->Show();
+ }
+ else if(dialog != NULL)
+ {
+ dialog->Show();
}
- dialog->Show();
}
-
/**
** Gets volume rendering image asociated to the given ID
**/
wxMaracasSurfaceRenderingManager* surrendmanager3;
int _id;
+
+ wxString volname;
};
#endif /*wxMaracasMultipleVolumeRendererPanel_H_*/