From 1622b6214967015983b3fb53dabeb599e4c8cda2 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 3 Feb 2020 16:22:58 +0100 Subject: [PATCH] #3358 creaMaracasVisu Feature New Normal - Box::ColorLayerImageView Change information reset offset in read image --- .../ColorLayerImageViewPanel.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index b749521..46c2aae 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -388,7 +388,24 @@ void ColorLayerImageViewPanel::onReadImage(wxCommandEvent& event) printf("EED ColorLayerImageViewPanel::onReadImage ....WARNING... Read dlg. all images creaImageIO ... ???\n"); creaMaracasVisuKernel::OpenImageDialog diag = creaMaracasVisuKernel::OpenImageDialog(); - SetImage( diag.getImageData() ); + + vtkImageChangeInformation *change = vtkImageChangeInformation::New(); + vtkImageData *img = diag.getImageData(); + int ext[6]; + double spc[6]; + double origin[3]; + img -> GetExtent( ext ); + img -> GetSpacing( spc ); + change -> SetInputData( img ); + origin[0]=0; + origin[1]=0; + origin[2]=0; + change -> SetOutputSpacing( spc[0] , spc[1] , spc [2] ); + change -> SetOutputExtentStart(0,0,0); + change -> SetOutputOrigin( origin ); + change -> Modified(); //important + change -> Update(); //important + SetImage( change->GetOutput() ); } //---------------------------------------------------------------------------- -- 2.45.1