From: Eduardo DAVILA Date: Mon, 3 Feb 2020 15:22:58 +0000 (+0100) Subject: #3358 creaMaracasVisu Feature New Normal - Box::ColorLayerImageView Change informat... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1622b6214967015983b3fb53dabeb599e4c8cda2;p=creaMaracasVisu.git #3358 creaMaracasVisu Feature New Normal - Box::ColorLayerImageView Change information reset offset in read image --- 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() ); } //----------------------------------------------------------------------------