]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorperez <perez>
Mon, 23 Nov 2009 14:33:45 +0000 (14:33 +0000)
committerperez <perez>
Mon, 23 Nov 2009 14:33:45 +0000 (14:33 +0000)
bbtk/src/bbcreaMaracasVisuVolumeRendering.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageManagementPanel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageManagementPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.h

index 0a9305baa0425f3173072da0d3ed16609c5b5faa..536391fe40c384ab68af9791bc490c06554ef667 100644 (file)
@@ -49,17 +49,13 @@ void VolumeRendering::Process()
                        }
                }       
 
-               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)
 {
index 85f4066b94c5cc690006549890901e2427cf9c98..99b01109b261483d8a7ef4fe7446302cc4db4139 100644 (file)
@@ -6,8 +6,8 @@
 ** 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();
@@ -134,52 +134,13 @@ void wxMaracasRenderImageManagementPanel::Transform(wxCommandEvent& event)
        //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
index a1b665ffcaf21eef0c5ec6da770dda9c893076b3..b970b3a73bc84bb74c594c5e3d08b7ec48e8e90b 100644 (file)
@@ -11,14 +11,11 @@ class creaMaracasVisu_EXPORT wxMaracasRenderImageManagementPanel : public wxDial
 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:
 
index 1960caa2c9def3d9f4370af4af815ee51ce1da0d..fe9eedcb38c3ba87b5904f788f7098be01f077fe 100644 (file)
@@ -11,8 +11,6 @@ wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracas
        surface2 = _surface2;
        surface3 = _surface3;
 
-       propID = id;
-
        transformV = vtkTransform::New();
        transformS1 = vtkTransform::New();
        transformS2 = vtkTransform::New();
@@ -25,51 +23,66 @@ wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracas
 **/
 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;
@@ -80,17 +93,8 @@ void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
        //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
index 7e7f4fc43f84997ee9d459fb07c06822c2e0e31e..314c59eaac785f4d0dc7175ce5e21997d7a54b42 100644 (file)
@@ -15,10 +15,7 @@ public:
                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:
index 5c9d88afc19fac2b00fe672ec8ef5663233f1a15..106f2a5d40c61e886a9a4c0754b0884674eae613 100644 (file)
@@ -21,6 +21,9 @@ wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent, int id)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
 {
        _id = id;
+
+       dialog = NULL;
+
        volmanager = new wxMaracasMultipleVolumeRendererManager();
        surrendmanager1 = new wxMaracasSurfaceRenderingManager();
        surrendmanager2 = new wxMaracasSurfaceRenderingManager();
@@ -91,6 +94,7 @@ void wxMaracasRenderTabbedPanel::createControls(vtkImageData* inImg, std::string
                        addSurface1(img, filename);
                        addSurface2(img, filename);
                        addSurface3(img, filename);     
+                       volname = (wxString) filename;
                        wxtabs->Refresh();
                }
        }       
@@ -520,14 +524,18 @@ void wxMaracasRenderTabbedPanel::onCheckBoxSCChange(wxCommandEvent& event)
 **
 **/
 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
 **/
index 811d6dbd181725c8eb53b392a79e2484242ccb1f..20159b05157ecc41dcd27955d7b3e5d3ebac07d3 100644 (file)
@@ -82,6 +82,8 @@ private:
        wxMaracasSurfaceRenderingManager* surrendmanager3;
 
        int _id;
+
+       wxString volname;
 };
 
 #endif /*wxMaracasMultipleVolumeRendererPanel_H_*/