diff --git a/vtk/src/layers/BackgroundImage.cpp b/vtk/src/layers/BackgroundImage.cpp index 6aa63f6..46b0b0f 100644 --- a/vtk/src/layers/BackgroundImage.cpp +++ b/vtk/src/layers/BackgroundImage.cpp @@ -62,32 +62,32 @@ void BackgroundImage::updateImage() { this->ren->AddActor(imageActor); - // camera stuff - // essentially sets the camera to the middle of the background, and points it at the background - // TODO: extract this to its own function, separate from the background class. - double origin[3], spacing[3]; - int extent[6]; - imageData->GetOrigin(origin); - imageData->GetSpacing(spacing); - imageData->GetExtent(extent); - - printf("%lf, %lf, %lf\n", origin[0], origin[1], origin[2]); - printf("%lf, %lf, %lf\n", spacing[0], spacing[1], spacing[2]); - printf("%d, %d, %d, ", extent[0], extent[1], extent[2]); - printf("%d, %d, %d\n", extent[3], extent[4], extent[5]); - - vtkCamera *camera = this->ren->GetActiveCamera(); - camera->ParallelProjectionOn(); - - double xc = origin[0] + 0.5 * (extent[0] + extent[1]) * spacing[0]; - double yc = origin[1] + 0.5 * (extent[2] + extent[3]) * spacing[1]; - double yd = (extent[3] - extent[2] + 1) * spacing[1]; - - printf("%lf, %lf, %lf\n", xc, yc, yd); - - camera->SetParallelScale(0.5 * yd); // sets to 330; should be 1 -> transform - camera->SetFocalPoint(xc, yc, 0.0); // sets to 0,0,0; isnice - camera->SetPosition(xc, yc, 1000); // sets to 0,0,1000; isnice + // // camera stuff + // // essentially sets the camera to the middle of the background, and points it at the background + // // TODO: extract this to its own function, separate from the background class. + // double origin[3], spacing[3]; + // int extent[6]; + // imageData->GetOrigin(origin); + // imageData->GetSpacing(spacing); + // imageData->GetExtent(extent); + // + // printf("%lf, %lf, %lf\n", origin[0], origin[1], origin[2]); + // printf("%lf, %lf, %lf\n", spacing[0], spacing[1], spacing[2]); + // printf("%d, %d, %d, ", extent[0], extent[1], extent[2]); + // printf("%d, %d, %d\n", extent[3], extent[4], extent[5]); + // + // vtkCamera *camera = this->ren->GetActiveCamera(); + // camera->ParallelProjectionOn(); + // + // double xc = origin[0] + 0.5 * (extent[0] + extent[1]) * spacing[0]; + // double yc = origin[1] + 0.5 * (extent[2] + extent[3]) * spacing[1]; + // double yd = (extent[3] - extent[2] + 1) * spacing[1]; + // + // printf("%lf, %lf, %lf\n", xc, yc, yd); + // + // camera->SetParallelScale(0.5 * yd); // sets to 330; should be 1 -> transform + // camera->SetFocalPoint(xc, yc, 0.0); // sets to 0,0,0; isnice + // camera->SetPosition(xc, yc, 1000); // sets to 0,0,1000; isnice }