CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
-#MARK_AS_ADVANCED( FORCE CMAKE_BACKWARDS_COMPATIBILITY )
-
-# for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003")
-IF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
- CMAKE_POLICY(SET CMP0003 NEW)
- CMAKE_POLICY(SET CMP0005 NEW)
-ENDIF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
-
-
PROJECT(creaImageIO)
void WxGimmick::ShowImage(vtkImageData* im)
{
// wxBusyCursor busy;
+ mViewer->SetInput( im );
+ mViewer->SetSlice( 0 );
+
int x1,x2,y1,y2,z1,z2;
double spx,spy,spz;
+ im->Update();
im->GetSpacing(spx,spy,spz);
im->GetExtent (x1,x2,y1,y2,z1,z2);
-
/*
+ std::cout << "-----------------------------"<<std::endl;
std::cout << x1 << "-"<<x2<<std::endl;
std::cout << y1 << "-"<<y2<<std::endl;
std::cout << z1 << "-"<<z2<<std::endl;
mspy = spy;
mspz = spz;
+ double *range = im->GetScalarRange();
+ mViewer->SetColorWindow(range[1] - range[0]);
+ mViewer->SetColorLevel(0.5 * (range[1] + range[0]));
+
+ mViewer->GetRenderer()->ResetCamera();
+ double bounds[6];
+
+
+ mViewer->GetRenderer()->ComputeVisiblePropBounds(bounds);
+
+ /*
+ std::cout <<"bounds : "<<bounds[0]<<","
+<<bounds[1]<<","
+<<bounds[2]<<","
+<<bounds[3]<<","
+<<bounds[4]<<","
+ <<bounds[5]<<std::endl;
+ */
+ mViewer->GetRenderer()->ResetCameraClippingRange(bounds);
+ /*
vtkCamera *camera = mViewer->GetRenderer()->GetActiveCamera();
camera->SetViewUp ( spx*0, -spy*1, spz*0);
camera->SetParallelScale( spx*(x2-x1)/2.0 );
camera->Roll ( 180 );
+ */
}
- mViewer->SetInput( im );
- mViewer->SetSlice( 0 );
mInteractor->Render();
}
//================================================================