source
path = "C: / Users / my / Desktop / OCT /";fileName = "OCT2D ("; fileEx = ") .bmp";
renderer = vtkSmartPointer :: New ();
vtkSmartPointer renderWindow = vtkSmartPointer :: New ();
renderWindow-> AddRenderer (renderer);
// Интерактор vtkSmartPointer renderWindowInteractor = vtkSmartPointer :: New ();renderWindowInteractor-> SetRenderWindow (renderWindow);
для (int i = 0; i
sumPath = path + fileName + ExchangeCString(i) + fileEx;
printf("%S\n", sumPath);
readerFactory[i] = vtkSmartPointer<vtkImageReader2Factory>::New();
imageReader[i].TakeReference(readerFactory[i]->CreateImageReader2(sumPath + ""));
imageReader[i]->SetFileName(sumPath + "");
imageReader[i]->Update();
imageData = imageReader[i]->GetOutput();
actor[i] = vtkSmartPointer<vtkImageActor>::New();
actor[i]->GetMapper()->SetInputData(imageData);
actor[i]->SetDisplayExtent(0, 300, 0, 300, 0, 0);
actor[i]->SetPosition(0.1, 0.1, i * 0.6);
renderer->AddActor(actor[i]);
}
// renderer-> SetBackground (1, 1, 1);// Цвет фона white renderer-> SetBackground (0.0, 0.0, 0.0);// 검은 색 배경
// Render renderWindow-> Render ();
vtkSmartPointer style = vtkSmartPointer :: New ();// как paraview
renderWindowInteractor-> SetInteractorStyle (style);
// Начать взаимодействие с мышью renderWindowInteractor-> Start ();