]> Creatis software - creaMaracasVisu.git/commitdiff
#3358 creaMaracasVisu Feature New Normal - Box::ColorLayerImageView Change informat...
authorEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Mon, 3 Feb 2020 15:22:58 +0000 (16:22 +0100)
committerEduardo DAVILA <davila@ei-ed-606.univ-lyon1.fr>
Mon, 3 Feb 2020 15:22:58 +0000 (16:22 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx

index b7495217b91066e559d7bcac9c55366a34e42091..46c2aae99bb70208ef1cd5729cd5dec5b0487d1b 100644 (file)
@@ -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() );
 }
 
 //----------------------------------------------------------------------------