[vtkusers] vtkSplineDrivenImageSlicer

JoseBarretoT jose.de.paula at live.com
Fri Apr 10 11:08:24 EDT 2015


Hello users,
I'm having trouble implementing the vtkSplineDrivenImageSlicer class.
  The problem is actually my way out, I should get a dental panoramic.

I do not understand why imageAppend returns blank.

Can you help me?


	private: void CriarPano(){
		vtkSmartPointer<vtkDICOMImageReader> imgReader =
vtkSmartPointer<vtkDICOMImageReader>::New();
		vtkSmartPointer<vtkXMLPolyDataReader> pathReader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
		vtkSmartPointer<vtkImageAppend> append =
vtkSmartPointer<vtkImageAppend>::New();
		vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
		vtkSmartPointer<vtkImageViewer2> imageViewer = vtkSmartPointer<
vtkImageViewer2>::New();

	
imgReader->SetDirectoryName("C:\\Users\\jose.barreto.EX_DENTAL\\Desktop\\Dentascan");
		pathReader->SetFileName("C:\\Users\\jose.barreto.EX_DENTAL\\Desktop\\git
exemplo\\src\\Documentation\\Resources\\closed_curve.vtp");
		pathReader->Update();
		imgReader->Update();

		reslicerGlobal->SetInputConnection(0, imgReader->GetOutputPort());
		reslicerGlobal->SetInputConnection(1, pathReader->GetOutputPort());

		reslicerGlobal->SetSliceExtent(512, 512);
		reslicerGlobal->SetSliceSpacing(0.75, 0.75);
		//reslicerGlobal->SetSliceThickness(0.4);
		reslicerGlobal->Update();

		int nbPoints = pathReader->GetOutput()->GetNumberOfPoints();
		for (int ptId = 0; ptId < nbPoints; ptId++)
		{
			reslicerGlobal->SetOffsetPoint(ptId);
			reslicerGlobal->Update();

			vtkSmartPointer<vtkImageData> tempSlice =
vtkSmartPointer<vtkImageData>::New();
			tempSlice->DeepCopy(reslicerGlobal->GetOutput(0));

			append->AddInputData(tempSlice);			
		}

		append->SetAppendAxis(2);
		append->Update();


		imageViewer->SetInputConnection(append->GetOutputPort());

		//adicionar a visualização ao panel
		imageViewer->SetParentId(panel1->Handle.ToPointer());
		imageViewer->SetSize(panel1->Width, panel1->Height);

		
		imageViewer->SetupInteractor(renderWindowInteractor);
		imageViewer->Render();
		imageViewer->GetRenderer()->ResetCamera();
		imageViewer->Render();


		renderWindowInteractor->Start();


	}



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkSplineDrivenImageSlicer-tp5731433.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list