From 9d4ab8e7b89d3c595787fe6e2ca08cf2c5510f27 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 7 Dec 2020 15:36:35 +0100 Subject: [PATCH] Resize by Spacing --- .../wxContourMainFrame.cxx | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 37cc8d3..48c038b 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -1177,10 +1177,11 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption) // wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL); wxFlexGridSizer *dialSizer = new wxFlexGridSizer(1); - wxString lstOptOperation[2]; - lstOptOperation[0]=_T("By Dimension"); - lstOptOperation[1]=_T("By Spacing"); - wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,90), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS); + wxString lstOptOperation[3]; + lstOptOperation[0]=_T("By Dimension (XY)"); + lstOptOperation[1]=_T("By Spacing (XY)"); + lstOptOperation[2]=_T("By Spacing (XYZ)"); + wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(370,200), 3 , lstOptOperation, 3, wxRA_SPECIFY_ROWS); dialSizer->Add( new wxStaticText(dial,-1,_T("The image resolution is not compatible with the ")) , 0, wxGROW ); dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?")) , 0, wxGROW ); @@ -1192,7 +1193,7 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption) dial->Layout(); dial->ShowModal(); - int _tmpReadFileTypeOfTransformation = -1; + _tmpReadFileTypeOfTransformation = -1; //EED bool transform = false; if (dial->GetReturnCode() == wxID_OK) @@ -1210,7 +1211,7 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption) //AD:04-06-09 void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool staticContour ) { - +printf ("EED wxContourMainFrame::openContours Start \n"); char tmp[255]; vtkImageData *image = _images[0]; @@ -1328,14 +1329,22 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static //nothing to do.. } else if (_tmpReadFileTypeOfTransformation==0){ double transX, transY; - transX = (double) imageDim[0]/_tmpReadFileImageDim[0]; - transY = (double) imageDim[1]/_tmpReadFileImageDim[1]; - manModelContour->Transform_Ax_Plus_B(transX,0,transY,0); + transX = (double) imageDim[0]/_tmpReadFileImageDim[0]; // X + transY = (double) imageDim[1]/_tmpReadFileImageDim[1]; // Y + manModelContour->Transform_Ax_Plus_B(transX,0,transY,0); } else if (_tmpReadFileTypeOfTransformation==1) { double transX, transY; - transX = (double) _tmpReadFileImageSpac[0]/imageDim[0]; - transY = (double) _tmpReadFileImageSpac[1]/imageDim[1]; + transX = (double) _tmpReadFileImageSpac[0]/imageSpac[0]; // X + transY = (double) _tmpReadFileImageSpac[1]/imageSpac[1]; // Y + manModelContour->Transform_Ax_Plus_B(transX,0,transY,0); + } else if (_tmpReadFileTypeOfTransformation==2) { // with Z include + double transX, transY; + transX = (double) _tmpReadFileImageSpac[0]/imageSpac[0]; // X + transY = (double) _tmpReadFileImageSpac[1]/imageSpac[1]; // Y + instantVector[1]=instantVector[1]*_tmpReadFileImageSpac[2]/imageSpac[2]; // Z manModelContour->Transform_Ax_Plus_B(transX,0,transY,0); + }else { + printf ("EED Warnning! wxContourMainFrame::openContours _tmpReadFileTypeOfTransformation not set. \n"); } fscanf(pFile,"%s",tmp); // TypeView @@ -1364,6 +1373,8 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static /* } */ +printf ("EED wxContourMainFrame::openContours END \n"); + } void wxContourMainFrame::RefreshInterface() -- 2.45.1