Help please. c++ to cuda

void CTTranslator::imageDisplayCoronal2D(){

this->displayImageCoronal->show();
this->displayImageCoronal->redraw();

	rendererCoronal = vtkRenderer::New();

renderWindowCoronal = vtkRenderWindow::New();
renderWindowCoronal->AddRenderer(rendererCoronal);

	displayImageCoronal->SetRenderWindow(renderWindowCoronal);
	displayImageCoronal->Initialize();

satLut = vtkLookupTable::New();
	satLut->SetTableRange (-250,1200);
	satLut->SetSaturationRange (0, 0);
	satLut->SetHueRange (0, 0); 
	satLut->SetValueRange (0, 2);
	satLut->Build();

colorsCoronal = vtkImageMapToColors::New();
	colorsCoronal->SetInput(reader2D->GetOutput());
	colorsCoronal->SetLookupTable(satLut);

actorCoronal = vtkImageActor::New();
	actorCoronal->SetInput(colorsCoronal->GetOutput());
actorCoronal->SetOpacity(1.0);
	actorCoronal->SetDisplayExtent(0,reader2D->GetWidth()-1, 250,250, 0,numberOfFilesOnSelectedFolder-1);
this->sliderCoronal->value(250);

cameraCoronal = vtkCamera::New();
 	cameraCoronal->SetViewUp(0, 0, -1);
 	cameraCoronal->SetPosition(0, 1, 0);
 	cameraCoronal->SetFocalPoint(0, 0, 0);
 	cameraCoronal->ComputeViewPlaneNormal();
cameraCoronal->Azimuth(-180);

rendererCoronal->AddActor(actorCoronal);
rendererCoronal->SetActiveCamera(cameraCoronal);
rendererCoronal->ResetCamera();
cameraCoronal->Dolly(1.0);
rendererCoronal->ResetCameraClippingRange();

generalInfoLogger(imageDisplayingCallbackInfo1"\n"">>");

pickerStarter(3);
isSizeFindet=1;

}

//! Display images as 3D.

/!Create a \a vtkRenderer and \a vtkRenderWindow for renderers to draw.
\n The images are read with \a vtkDICOMImageReader and the isosurface is trough \a vtkMarchingCubes genearated.
\n The output from \a vtkMarchingCubes is given \a vtkPolyDataMapper and \a vtkActor to create a geometry.
\n For the correct position and orientation of the 3D image are a virtual camera trough \a vtkCamera created.
\n In “General Info” area is the Informationmessage \a imageDisplayingCallbackInfo3 displayed.
/
void CTTranslator::imageDisplayingCallback3D(){

this->saveButton->activate();
this->exportChoice->add("3D",0,NULL);
this->largerViewChoice->add("3D",0,NULL);
this->colorMenuButton->add("&3D/White",0,NULL);
this->colorMenuButton->add("&3D/Red",0,NULL);
this->colorMenuButton->add("&3D/Yellow",0,NULL);
this->colorMenuButton->add("&3D/Green",0,NULL);
this->colorMenuButton->add("&3D/Blue",0,NULL);
this->colorMenuButton->add("&3D/Orange",0,NULL);

reader2D->SetDirectoryName(selectedDirectory);

	displayImage3D->show();
displayImage3D->redraw();

//Read the images
reader2D->SetFileDimensionality( 3 );
reader2D->SetDataExtent( 0,reader2D->GetWidth()-1 , 0,reader2D->GetHeight()-1, 0,numberOfFilesOnSelectedFolder-1);
reader2D->SetDataOrigin(0.0, 0.0, 0.0);
reader2D->SetDataSpacing( 1,1,1 );
reader2D->SetNumberOfScalarComponents( 1 );
reader2D->SetDataByteOrderToBigEndian();
reader2D->UpdateWholeExtent();

// Create renderer and renderwindow
renderer3D = vtkRenderer::New();

renderWindow3D = vtkRenderWindow::New();
renderWindow3D->AddRenderer(renderer3D);

	displayImage3D->SetRenderWindow(renderWindow3D);
	displayImage3D->Initialize();

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Generate an isosurface
marchingCubes = vtkMarchingCubes::New();
marchingCubes->SetInput(reader2D->GetOutput());
marchingCubes->GenerateValues(1, (int)this->sliderRangeMin->value()-(int)this->sliderRangeMax->value()/2, (int)this->sliderRangeMin->value()+(int)this->sliderRangeMax->value()/2);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Take the isosurface data and create geometry
mapper3D = vtkPolyDataMapper::New();
mapper3D->SetInput(marchingCubes->GetOutput());
mapper3D->ScalarVisibilityOff();

actor3D = vtkActor::New();
actor3D->SetMapper(mapper3D);
actor3D->GetProperty()->SetColor( 1, 1, 1 );

camera3D = vtkCamera::New();
	camera3D->SetViewUp(0, 0, -1);
	camera3D->SetPosition(0, 1, 0);
	camera3D->SetFocalPoint(0, 0, 0);
	camera3D->ComputeViewPlaneNormal();
camera3D->Azimuth(20);

renderer3D->AddActor(actor3D);
renderer3D->SetActiveCamera(camera3D);
renderer3D->ResetCamera();
camera3D->Dolly(1.3);
renderer3D->ResetCameraClippingRange();

generalInfoLogger(imageDisplayingCallbackInfo3"\n"">>");

inProgressStatusController=2;

this->progressBar->value(70);

Help please. translate this program or need cuda.
}
CTTranslator.cpp (60.6 KB)

You’re kidding, right? :haha:

:thumbup: i lol’d