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() );
}
//----------------------------------------------------------------------------