From badc6cea49d018dec82191a977fc082299a1da35 Mon Sep 17 00:00:00 2001
From: Eduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Date: Wed, 29 Sep 2010 21:21:00 +0000
Subject: [PATCH] no message

---
 bbtk/bbs/appli/example_Segmentation_02.bbs    |   2 +-
 bbtk/src/bbcreaMaracasVisuCutModule2.cxx      |   3 +-
 bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx  |   3 +-
 .../src/bbcreaMaracasVisuSurfaceRendering.cxx |   2 +-
 bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx      |  20 +--
 bbtk/src/bbmaracasvisuShowNPoints.cxx         |  12 +-
 .../CutModule/interface/CutModelMainPanel.cxx |   9 +-
 .../src/CutModule/kernel/CutModelData.cxx     |   6 +-
 .../src/CutModule/kernel/CutModelFigure.h     |   2 +-
 .../src/CutModule/kernel/CutModelManager.cxx  |  16 ++-
 .../widgets/PlaneDirectionViewer.cxx          |   5 +-
 .../ColorLayerImageViewPanel.cxx              | 136 ++++++++++++++++--
 .../ColorLayerImageViewPanel.h                |  19 ++-
 .../ThresholdImageView/LayerImageBase.h       |   2 +-
 .../widgets/manualContour/manualViewPoint.h   |   2 +-
 .../wxWindows/widgets/pPlotter/mBarRange.cxx  |  44 +++---
 .../wxMaracasMultipleVolumeRendererPanel.cxx  |   7 +-
 .../widgets/wxMaracasRendererView.cxx         |   2 +-
 .../widgets/wxMaracasSurfaceRenderingPanel.h  |   2 +-
 .../src/kernel/PlaneDirectionManager.cxx      |  28 ++--
 20 files changed, 239 insertions(+), 83 deletions(-)

diff --git a/bbtk/bbs/appli/example_Segmentation_02.bbs b/bbtk/bbs/appli/example_Segmentation_02.bbs
index ecc5576..3d0aeea 100644
--- a/bbtk/bbs/appli/example_Segmentation_02.bbs
+++ b/bbtk/bbs/appli/example_Segmentation_02.bbs
@@ -4,7 +4,7 @@ author "eduardo.davila@creatis.insa-lyon.fr"
 
 
 load std
-load vtk
+include vtk
 load wx
 load creaMaracasVisu
 
diff --git a/bbtk/src/bbcreaMaracasVisuCutModule2.cxx b/bbtk/src/bbcreaMaracasVisuCutModule2.cxx
index 9e5369a..6824d96 100644
--- a/bbtk/src/bbcreaMaracasVisuCutModule2.cxx
+++ b/bbtk/src/bbcreaMaracasVisuCutModule2.cxx
@@ -28,7 +28,8 @@ namespace bbcreaMaracasVisu
 	void CutModule2::CreateWidget(wxWindow* parent)
 	{
 	   std::string lastname("bbcreaMaracasVisu.dll");    // JPR
-           std::string path = crea::System::GetDllAppPath(lastname);
+		std::string path = crea::System::GetDllAppPath(lastname);
+		
            _mainpanel = CutModelMainPanel::getInstance(parent, path);
            _mainpanel->SetType(1);
 		
diff --git a/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx b/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx
index 64d1c1f..1c03a1e 100644
--- a/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx
+++ b/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx
@@ -34,7 +34,8 @@ void PlaneDirection::Process()
 			spc[2]=1;
 		}
 		
-		for(int i = 0; i < lstPointsx.size();i++){			
+		int i;
+		for(i = 0; i < (int)lstPointsx.size();i++){			
 			_lstPointsx.push_back(lstPointsx[i]*spc[0]);
 			_lstPointsy.push_back(lstPointsy[i]*spc[1]);
 			_lstPointsz.push_back(lstPointsz[i]*spc[2]);
diff --git a/bbtk/src/bbcreaMaracasVisuSurfaceRendering.cxx b/bbtk/src/bbcreaMaracasVisuSurfaceRendering.cxx
index b2f7915..68a2e3d 100644
--- a/bbtk/src/bbcreaMaracasVisuSurfaceRendering.cxx
+++ b/bbtk/src/bbcreaMaracasVisuSurfaceRendering.cxx
@@ -28,7 +28,7 @@ void SurfaceRendering::Process()
 		tempvect.push_back(bbGetInputIn3());
 		tempvect.push_back(bbGetInputIn4());
 
-		for(i = 0; i < tempvect.size();i++){
+		for(i = 0; i < (int)tempvect.size();i++){
 			prop3D = tempvect[i];
 			if(prop3D != NULL&&renderer != NULL){
 				surrend->addPropMHD(prop3D);
diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
index ab3ad31..8d73245 100644
--- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
+++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
@@ -55,18 +55,22 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
 	// color
 	double r,g,b;
 
-	if ( (iAxis*3+1) < (int)(bbGetInputColour().size()) ){
+	if ( (iAxis*3+1) < (int)(bbGetInputColour().size()) )
+	{
 			r = bbGetInputColour()[0+iAxis*3];
 			g = bbGetInputColour()[1+iAxis*3]; 
 			b = bbGetInputColour()[2+iAxis*3];
-		} else {
-			r = bbGetInputColour()[0];
-			g = bbGetInputColour()[1]; 
-			b = bbGetInputColour()[2];
-		}
+	} else {
+//			r = bbGetInputColour()[0];
+//			g = bbGetInputColour()[1]; 
+//			b = bbGetInputColour()[2];
+			r = (rand() % 100) / 100.0;
+			g = (rand() % 100) / 100.0;
+			b = (rand() % 100) / 100.0;
+	}
 
-	vtkactor->GetProperty()->SetColor( 1,0,0 );
-	vtkactor->GetProperty()->SetLineWidth( 3 );
+	vtkactor->GetProperty()->SetColor( r,g,b );
+	vtkactor->GetProperty()->SetLineWidth( 0.5 );
 
 	if ( bbGetInputTransform()!=NULL )
 	{
diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx
index 1b1845a..d9e198e 100644
--- a/bbtk/src/bbmaracasvisuShowNPoints.cxx
+++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx
@@ -20,16 +20,16 @@ namespace bbcreaMaracasVisu
     wxSizer *sizer			= NULL;
 
 	// Widget interface
-	askPointLabel			= new wxStaticText(panel, -1, _T("Point label :")); // JPR
-	textCtrl			= new wxTextCtrl(panel, -1);
+	askPointLabel				= new wxStaticText(panel, -1, _T("Point label :")); // JPR
+	textCtrl					= new wxTextCtrl(panel, -1);
 	wxButton *btnAddPoint		= new wxButton( panel, -1, _T("Add Point"));
 	wxButton *btnRenamePoint	= new wxButton( panel, -1, _T("Rename point"));
 	wxButton *btnEraseLastPoint	= new wxButton( panel, -1, _T("Erase Last point"));
 	wxButton *btnErasePoint		= new wxButton( panel, -1, _T("Erase point"));
-	wxButton *btnDeleteAllPoints	= new wxButton( panel, -1, _T("Delete all points"));
+	wxButton *btnDeleteAllPoints= new wxButton( panel, -1, _T("Delete all points"));
 	wxButton *btnSavePoints		= new wxButton( panel, -1, _T("Save points"));
 	wxButton *btnLoadPoints		= new wxButton( panel, -1, _T("Load points"));
-	txtNrPoints			= new wxStaticText(panel,-1, _T(" "));
+	txtNrPoints					= new wxStaticText(panel,-1, _T(" "));
 
 	//NTU: Sliders for opacity and radio change
 
@@ -276,7 +276,7 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
 					y=lstPointsY[i];
 					z=lstPointsZ[i];
 					value= mimage->GetScalarComponentAsDouble(x,y,z,0);
-					fprintf(ff,"%d\t %d\t %d\t %f\t %s\n", x , y , z , value  , lstLabels[i].c_str());
+					fprintf(ff,"%d\t%d\t%d\t%f\t%s\n", x , y , z , value  , lstLabels[i].c_str());
 				} // for
 				fclose(ff);
 			} else {   // else ff
@@ -318,7 +318,7 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event)
 				int x,y,z;
 				for (i=0; i<size; i++)
 				{
-					fscanf(ff," %d %d %d %f %s",&x,&y,&z,&value,chartmp );  // x,y,z,value,label
+					fscanf(ff,"%d%d%d%f%s",&x,&y,&z,&value,chartmp );  // x,y,z,value,label
 					AddPoint(x,y,z, chartmp );
 				}
 				fclose(ff);
diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx
index a226519..f917adc 100644
--- a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx
+++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx
@@ -3,8 +3,8 @@
 Program:   wxMaracas
 Module:    $RCSfile: CutModelMainPanel.cxx,v $
 Language:  C++
-Date:      $Date: 2010/04/29 16:05:33 $
-Version:   $Revision: 1.10 $
+Date:      $Date: 2010/09/29 21:21:03 $
+Version:   $Revision: 1.11 $
 
 Copyright: (c) 2002, 2003
 License:
@@ -126,10 +126,11 @@ void CutModelMainPanel::RemoveActor(int id){
 		checkInvariant();
 
 		if(!this->IsBeingDeleted()){
-			for(int i = 0; i < viewpanels.size()-1;i++){
+			int i,j;
+			for(i = 0; i < (int)viewpanels.size()-1;i++){
 				CutModelView* view = viewpanels[i];
 				if(view->getId()==id){
-					for(int j = i; j < viewpanels.size()-1;j++){
+					for(j = i; j < (int)viewpanels.size()-1;j++){
 						viewpanels[j]=viewpanels[j+1];
 					}
 					i = viewpanels.size();
diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
index 63fa928..9a62a58 100644
--- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
+++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: CutModelData.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/31 12:41:58 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2010/09/29 21:21:05 $
+  Version:   $Revision: 1.7 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -332,7 +332,7 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
 
 void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw( CutModelException){
 	
-	double *spc = img->GetSpacing();  // spc unused // JPR
+//	double *spc = img->GetSpacing();  // spc unused // JPR
 
 	currentmatrix->Identity();	
 
diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelFigure.h b/lib/maracasVisuLib/src/CutModule/kernel/CutModelFigure.h
index f204ee6..5b43767 100644
--- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelFigure.h
+++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelFigure.h
@@ -9,7 +9,7 @@ class CutModelFigure
 public:
 	CutModelFigure(){}	
 	
-	//~CutModelFigure();
+	virtual ~CutModelFigure(){}
 
 	virtual void SetPosition(double x,double y, double z){
 		_px = x;
diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx
index bfd82ed..53139ea 100644
--- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx
+++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx
@@ -3,8 +3,8 @@
 Program:   wxMaracas
 Module:    $RCSfile: CutModelManager.cxx,v $
 Language:  C++
-Date:      $Date: 2010/04/02 07:22:25 $
-Version:   $Revision: 1.9 $
+Date:      $Date: 2010/09/29 21:21:05 $
+Version:   $Revision: 1.10 $
 
 Copyright: (c) 2002, 2003
 License:
@@ -142,7 +142,9 @@ void CutModelManager::ChangeShape(int id,int selection)throw( CutModelException)
 CutModelData* CutModelManager::getCutModelData(int id)throw( CutModelException){
 
 	CutModelData* current = NULL;
-	for(int i= 0; i < _vectordata.size();i++){
+	int i;
+	for(i= 0; i < (int)_vectordata.size();i++)
+	{
 		CutModelData* temp = _vectordata[i];
 		std::cout<<"id in CutModelManager:: "<<id<<std::endl;
 		std::cout<<"vectordataid in CutModelManager:: "<<temp->getId()<<std::endl;
@@ -177,9 +179,11 @@ void CutModelManager::RemoveActor(int id)throw( CutModelException){
 	checkInvariant();
 
 	CutModelData* current = getCutModelData(id);
-	for(int i = 0; i < _vectordata.size()-1;i++){
+	int i,j;
+	for(i = 0; i < (int)_vectordata.size()-1;i++)
+	{
 		if(_vectordata[i]->getId()==id){				
-			for(int j = i; j < _vectordata.size()-1;j++){
+			for(j = i; j < (int)_vectordata.size()-1;j++){
 				_vectordata[j]=_vectordata[j+1];
 			}
 			i = _vectordata.size();
@@ -291,7 +295,7 @@ int CutModelManager::Undo()	throw( CutModelException){
 
 int CutModelManager::Redo()	throw( CutModelException){
 
-	if(_currentaction >= 0 && _currentaction < _undoredo.size()){
+	if(_currentaction >= 0 && _currentaction < (int)_undoredo.size()){
 
 		CutModelSaveBinInfo* currentundo = _undoredo[_currentaction];
 		CutModelData* currentmodel;
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx
index 63c163f..ed0f07d 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx
@@ -43,12 +43,13 @@ void PlaneDirectionViewer::SetVectors( std::vector<double> lstPointsx, std::vect
 void PlaneDirectionViewer::UpdateDirections() throw (std::exception){
 	manager->UpdateDirections();
 	std::vector<PlaneDirectionManagerData*> vectdata = manager->GetPlanesData();
-	for(int i = 0; i < viewdata.size();i++){
+	int i;
+	for(i = 0; i < (int)viewdata.size();i++){
 		this->GetSizer()->Remove(i);
 		viewdata[i]->Destroy();
 	}
 	viewdata.clear();	
-	for(int i = 0; i < vectdata.size(); i++){
+	for(i = 0; i < (int)vectdata.size(); i++){
 		PlaneDirectionViewerPanel* planedirview = new PlaneDirectionViewerPanel(this, vectdata[i],i);
 		viewdata.push_back(planedirview);
 		this->GetSizer()->Add(planedirview,1);
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
index 6ea524f..d574e30 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
@@ -10,19 +10,64 @@
 #include "OpenImageDialog.h"
 
 
+wxDlgTransformByDimensionBySpacingByPixel::wxDlgTransformByDimensionBySpacingByPixel()
+{
+}
+
+wxDlgTransformByDimensionBySpacingByPixel::~wxDlgTransformByDimensionBySpacingByPixel()
+{
+}
+
+
+void wxDlgTransformByDimensionBySpacingByPixel::GetTransformType(wxWindow *parent , wxString message,int &typeOfTransformation,bool &dlgWxOK)
+{
+	wxDialog* dial			= new wxDialog (parent,-1,_T("Tools"),wxDefaultPosition, wxSize(590,190));
+	wxSizer* buttonsSizer	= dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
+	wxBoxSizer *dialSizer	= new wxBoxSizer(wxVERTICAL);
+	
+	wxString lstOptOperation[3];
+	lstOptOperation[0]=_T("By Dimension");
+	lstOptOperation[1]=_T("By Spacing");
+	lstOptOperation[2]=_T("By Pixel");
+	wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 3 , lstOptOperation,  3, wxRA_SPECIFY_COLS);		
+	
+	dialSizer->Add( new wxStaticText(dial,-1,message)  , 0, wxGROW );
+	//	dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?"))  , 0, wxGROW );	
+	dialSizer->Add( new wxStaticText(dial,-1,_T(" "))  , 0, wxGROW );		
+	dialSizer->Add(radioOpts,0,wxGROW);
+	dialSizer->Add( new wxStaticText(dial,-1,_T(" "))  , 0, wxGROW );	
+	dialSizer->Add(buttonsSizer,0,wxGROW);
+	dial->SetSizer(dialSizer, true);
+	dial->Layout();
+	dial->ShowModal();
+	
+	typeOfTransformation	= -1;
+	dlgWxOK					= false;
+	
+	if (dial->GetReturnCode() == wxID_OK)
+	{
+		typeOfTransformation	= radioOpts->GetSelection();
+		dlgWxOK				= true;
+	}
+}
+
+//---------------------------------------------------------
+
+
+
 /**
  ** Begin of the threshold panel
  **/
 ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max, int type)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 {
-	_colorLayerImageView = new ColorLayerImageView();
-
-	_btn_ReadImage = new wxButton(this, wxID_ANY, _T("Read Image") );
-	
+	_spcBase[0] = _spcBase[1] = _spcBase[2] = 0;
+	_dimBase[0] = _dimBase[1] = _dimBase[2] = 0;
 
-	_thresholdGo = true;
-	_cb_ShowHide = new wxCheckBox(this, wxID_ANY, _T("Show/Hide layer") );
+	_colorLayerImageView	= new ColorLayerImageView();
+	_btn_ReadImage			= new wxButton(this, wxID_ANY, _T("Read Image") );
+	_thresholdGo			= true;
+	_cb_ShowHide			= new wxCheckBox(this, wxID_ANY, _T("Show/Hide layer") );
 	_cb_ShowHide->SetValue(_thresholdGo);
 
 	_cb_SliceFixDinamic = new wxCheckBox(this, wxID_ANY, _T("Slice Fix/Dinamic") );
@@ -92,25 +137,98 @@ void ColorLayerImageViewPanel::SetColorLayerImageView(ColorLayerImageView* color
 	_colorLayerImageView = colorLayerImageView;
 }
 
+// This is the new spacing of the background image  (1,1,1)
+void ColorLayerImageViewPanel::SetBaseSpacing(double spc[3])
+{
+	_spcBase[0] = spc[0];
+	_spcBase[1] = spc[1];
+	_spcBase[2] = spc[2];
+	
+	_spcBase[0] = 1;
+	_spcBase[1] = 1;
+	_spcBase[2] = 1;
+}
+
+// This is the Original spacing of the background image
+void ColorLayerImageViewPanel::SetOriginalSpacing(double spc[3])
+{
+	_spcOrg[0] = spc[0];
+	_spcOrg[1] = spc[1];
+	_spcOrg[2] = spc[2];
+}
+
+// This is the size in pixels of the background image
+void ColorLayerImageViewPanel::SetBaseDimension(int dim[3])
+{
+	_dimBase[0] = dim[0];
+	_dimBase[1] = dim[1];
+	_dimBase[2] = dim[2];
+}
+
 //----------------------------------------------------------------------------
 void ColorLayerImageViewPanel::onReadImage(wxCommandEvent& event)
 {
 // EED ???
 //      creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB"); 
 //      w.ShowModal(); 
+	printf("EED ColorLayerImageViewPanel::onReadImage ....WARNING... Read dlg. all images creaImageIO ... ???\n");
 
 	creaMaracasVisuKernel::OpenImageDialog diag = creaMaracasVisuKernel::OpenImageDialog();
 	_colorLayerImageView->SetImage( diag.getImageData() );
 
+	double spc[3];
+	diag.getImageData()->GetSpacing(spc);
+	
+	int dim[3];
 	int ext[6];
 	diag.getImageData()->GetWholeExtent(ext);
-	_sl_SliceImage->SetRange( 0 , ext[5]-ext[4] );
-
+	dim[0] = ext[1]-ext[0];
+	dim[1] = ext[3]-ext[2];
+	dim[2] = ext[5]-ext[4];
+	_sl_SliceImage->SetRange( 0 , dim[2] );
+		
+	if ( (spc[0]!=_spcBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2]) || 	
+		 (dim[0]!=_dimBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2]) 
+		)
+	{
+		
+		bool transformOkDlg;
+		int typeOfTransformation;
+		wxString msg = _T("The image resolution of both images are not compatible. Do you want to tranform it? ");
+	    wxDlgTransformByDimensionBySpacingByPixel dlg;
+		dlg.GetTransformType(this,msg,typeOfTransformation,transformOkDlg);
+		
+printf("EED ColorLayerImageViewPanel::onReadImage call dialog spc size,dim...???\n");
+		
+		if (typeOfTransformation==0)  // make dimensions equals 
+		{
+			printf("EED ColorLayerImageViewPanel::onReadImage ...WARNNING.... dif size image spc*dim ofnew image ...???\n");
+			spc[0]=_spcBase[0]*_dimBase[0]/dim[0];
+			spc[1]=_spcBase[1]*_dimBase[1]/dim[1];
+			spc[2] = 1;
+		}
+		
+		if (typeOfTransformation==1)  // make spacing equals
+		{
+			spc[0] = ( _spcBase[0]/spc[0] ) * _spcOrg[0];
+			spc[1] = ( _spcBase[1]/spc[1] ) * _spcOrg[1];
+			spc[2] = ( _spcBase[2]/spc[2] ) * _spcOrg[2];
+		}
+		
+		if (typeOfTransformation==2)  // make spacing = 1
+		{
+			spc[0] = 1;
+			spc[1] = 1;
+			spc[2] = 1;
+		}
+		
+		diag.getImageData()->SetSpacing(spc);
+	} // spc !_spcBase   dim!__dimBase
+	
 	_colorLayerImageView->onThreshold();
 	_colorLayerImageView->GetwxVtkBaseView()->Refresh();
 }
 
-
 //----------------------------------------------------------------------------
 void ColorLayerImageViewPanel::onThresholdChange(wxCommandEvent& event)
 {
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h
index 3927cc9..3b19119 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h
@@ -19,6 +19,17 @@
 #include "ColorLayerImageView.h"
 
 	
+//EED 21-08-2010
+class wxDlgTransformByDimensionBySpacingByPixel
+	{
+	public:
+		wxDlgTransformByDimensionBySpacingByPixel();
+		~wxDlgTransformByDimensionBySpacingByPixel();
+		void GetTransformType(wxWindow *parent , wxString message,int &typeOfTransformation,bool &dlgWxOK) ;
+	};
+
+//-----------------------------------------------------
+
 	class ColorLayerImageViewPanel
 		: public wxPanel
 		{
@@ -28,9 +39,15 @@
 			void onThresholdStop();
 			void SetColorLayerImageView(ColorLayerImageView* colorLayerImageView);
 			bool IsVisible();
+			void SetBaseSpacing(double spc[3]);
+			void SetBaseDimension(int dim[3]);
+			void SetOriginalSpacing(double spc[3]);
 			
 		private:
-			
+			int					_dimBase[3];
+			double				_spcBase[3];
+			double				_spcOrg[3];
+
 			bool				_thresholdGo;
 			ColorLayerImageView	*_colorLayerImageView;
 			wxButton			*_btn_ReadImage;
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h
index a96a2b3..d7c6cbc 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h
@@ -25,7 +25,7 @@ class LayerImageBase
   {
   public: 
 		LayerImageBase();
-		~LayerImageBase();
+		virtual ~LayerImageBase();
 		void SetZ(int z);
 		void SetImage(vtkImageData* image);
 		void SetwxVtkBaseView(wxVtkBaseView *baseview);
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h
index 6739be1..2ee3c3c 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h
@@ -31,7 +31,7 @@ class manualViewPoint{
 public:
 
 	manualViewPoint(wxVtkBaseView *wxvtkbaseview);
-	~manualViewPoint();
+	virtual ~manualViewPoint();
 
 	virtual manualViewPoint * Clone();
 	void CopyAttributesTo( manualViewPoint *cloneObject );
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
index 6de905c..70e1b8b 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
@@ -43,12 +43,12 @@ END_EVENT_TABLE()
 mBarRange::mBarRange(wxWindow *parent, int w, int h)
 :wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL)
 {
-	acceptedClick = true;
+	acceptedClick		= true;
 	_bitmap_bar			=	NULL;
 	SetWidth (w);
 	SetHeight(h);
 	_initialPoint		=	0;
-	trianglesHalfWidth = 5;
+	trianglesHalfWidth	= 5;
 	
 	wxColour start_Colour;
 
@@ -418,22 +418,22 @@ void mBarRange::RefreshHorizontalView()
 	wxPoint points[3];
 
 	//int largestNumberWidthInPixels = 15; // JPRx
-	int pxStart=GetPixelStart();
-	int pxEnd=GetPixelEnd();
-	int pxActual=GetPixelActual();
+	int pxStart		= GetPixelStart();
+	int pxEnd		= GetPixelEnd();
+	int pxActual	= GetPixelActual();
 
 	
-	int letterHeight = 9;
-	int barHeight = 2*letterHeight;
-	int tempHeight = _h-(6*letterHeight);
+	int letterHeight= 9;
+	int barHeight	= 2*letterHeight;
+	int tempHeight	= _h-(6*letterHeight);
 	
 	
 	if (_visibleLables)
 	{
-		barHeight = (tempHeight>0)  ? tempHeight : (int) _h/2;
+		barHeight	= (tempHeight>0)  ? tempHeight : (int) _h/2;
 	}
 	else
-		barHeight = _h;	
+		barHeight	= _h;	
 
 	wxMemoryDC temp_dc;
 	temp_dc.SelectObject( *_bitmap_bar );
@@ -683,24 +683,24 @@ void mBarRange::RefreshVerticalView()
 
 
 	// 2 Shadow Triangles: Start and End 
-	points[0].x=_h;
-	points[0].y=0;
-	points[1].x=0;
-	points[1].y=-trianglesHalfWidth-1;
-	points[2].x=0;
-	points[2].y=trianglesHalfWidth+2;
+	points[0].x	= _h;
+	points[0].y	= 0;
+	points[1].x	= 0;
+	points[1].y	= -trianglesHalfWidth-1;
+	points[2].x	= 0;
+	points[2].y	= trianglesHalfWidth+2;
 	temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
 	temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
 	temp_dc.DrawPolygon(3,points,0,px1);
 	temp_dc.DrawPolygon(3,points,0,px2);
 
 	// 2 Triangles: Start and End 
-	points[0].x=_h;
-	points[0].y=0;
-	points[1].x=0;
-	points[1].y=-trianglesHalfWidth;
-	points[2].x=0;
-	points[2].y=trianglesHalfWidth;
+	points[0].x	= _h;
+	points[0].y	= 0;
+	points[1].x	= 0;
+	points[1].y	= -trianglesHalfWidth;
+	points[2].x	= 0;
+	points[2].y	= trianglesHalfWidth;
 	//first triangle (start)
 	if( _selectionMoveId==1 )
 	{
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx
index c9e879a..1d8bc3e 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx
@@ -51,8 +51,8 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){
 	
 	if(!isComplexBox)
 	{
-		wxStaticText* label = new wxStaticText(this, -1, wxString(_T("")));	
-		wxStaticText* label2 = new wxStaticText(this, -1, wxString(_T("")));
+//		wxStaticText* label = new wxStaticText(this, -1, wxString(_T("")));	
+//		wxStaticText* label2 = new wxStaticText(this, -1, wxString(_T("")));
 
 
 		checkbox = new  wxCheckBox(this,-1,wxString(_T("Show Actor")));
@@ -224,7 +224,8 @@ void wxMaracasMultipleVolumeRendererPanel::onViewImage(wxCommandEvent& event)
 		img = wxMaracasMultipleVolumeRendererView::getInstance()->getVolumeRenderManager()->getImageData();
 	}
 
-	wxMaracas_N_ViewersWidget* viewer = new wxMaracas_N_ViewersWidget(frame, img, &type);
+	//	wxMaracas_N_ViewersWidget* viewer = new wxMaracas_N_ViewersWidget(frame, img, &type);
+	new wxMaracas_N_ViewersWidget(frame, img, &type);
 	frame->Show();
 }
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx
index 8de5499..ceffcaf 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx
@@ -80,7 +80,7 @@ std::string wxMaracasRendererView::getPath()
 wxMaracasRenderTabbedPanel* wxMaracasRendererView::getTabbedPanel(int id) throw(char*)
 {
 	int i;
-	for(i = 0; i < (tabsVector.size()); i++)
+	for(i = 0; i < (int)tabsVector.size(); i++)
 	{
 		if(tabsVector[i]->getPropIdV() == id)
 			return tabsVector[i];
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingPanel.h
index b1759bb..3c3209d 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingPanel.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingPanel.h
@@ -62,7 +62,7 @@ public:
 	virtual void onActionButtonPressedHide( wxCommandEvent& event ){
 		wxList list = sizercontrols->GetChildren();		
 		int i;
-		for(i=0; i<list.size();i++){
+		for(i=0; i<(int)list.size();i++){
 			sizercontrols->Show(i,show);
 		}
 		show = !show;
diff --git a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx
index 0a95f5c..20ef0da 100644
--- a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx
+++ b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx
@@ -32,11 +32,14 @@ void PlaneDirectionManager::UpdateDirections() throw (std::exception){
 	AddActors();
 
 }
+
 void PlaneDirectionManager::AddActors(){
-    for(int i = 0; i < _vectdata.size();i++){
+	int i;
+    for(i = 0; i < (int)_vectdata.size();i++){
 		_render->AddViewProp (_vectdata[i]->GetActor());		
 	}
 }
+
 void PlaneDirectionManager::RemoveAllActorsFromIndex(int n)throw (std::exception){
 	/*due to incompleate set of points to create the plane
 	*/				
@@ -53,9 +56,10 @@ void PlaneDirectionManager::UpdateVectors()throw (std::exception){
 	PlaneDirectionManagerData* temp;
 	bool deletelast = false;
 	int currentdata = 0;
-	for(int i = 0; i < _lstPointsx.size();i++){
+	int i;
+	for(i = 0; i < (int)_lstPointsx.size();i++){
 		if(i % 3 == 0){	
-			if(_vectdata.size()>currentdata){
+			if((int)_vectdata.size()>currentdata){
 				temp = _vectdata[currentdata];
 			}else{
 				temp = new PlaneDirectionManagerData(_radio, _colour, _opacity);
@@ -74,15 +78,18 @@ void PlaneDirectionManager::UpdateVectors()throw (std::exception){
 	RemoveAllActorsFromIndex(currentdata);
 }
 
-void PlaneDirectionManager::UpdateActors(){
-    for(int i = 0; i < _vectdata.size();i++){
+void PlaneDirectionManager::UpdateActors()
+{
+	int i;
+    for(i = 0; i < (int)_vectdata.size();i++)
+	{
 		_vectdata[i]->UpdateActor();
 	}
 }
 
-void PlaneDirectionManager::addRemoveActor(int index, bool addremove){
-
-	if(index < _vectdata.size()){
+void PlaneDirectionManager::addRemoveActor(int index, bool addremove)
+{
+	if(index < (int)_vectdata.size()){
 		if(addremove){
 			_render->AddViewProp (_vectdata[index]->GetActor());
 		}else{
@@ -111,8 +118,9 @@ void PlaneDirectionManager::WriteInformation(std::string  filename, double* spc)
 		spc[2] = 1;
 	}
 	if (ff!=NULL)
-	{	        
-		for(int i = 0; i < _vectdata.size();i++){
+	{	    
+		int i;
+		for(i = 0; i < (int)_vectdata.size();i++){
 
 			double* p0 = _vectdata[i]->getPoint0();
 			double* p1 = _vectdata[i]->getPoint1();
-- 
2.49.0