[vtkusers] vtkContourWidget with vtkImageSlice

Jose Barreto jose.de.paula at live.com
Wed Jul 15 10:21:39 EDT 2015


Thanks Cory ,

I searched on Google and quite managed to connect the two objects, the point
is that these results have described the images below ..

  What happens in the scene is as follows:
the User moves the yellow line in the sagittal image (image over the display
left), I show this picture in sagial view (monitor right over the picture),
starting give it start creating vtkContourWidget object in this image.

What I can not do at all, and move this object created. As u can see in the
picture 3 he is recorded that Z regarding the image that was created in the
axial.
>From that point up (where he is until the top of the head) he will appear, I
can not move it down, which is what I need. (Able to move it to any image).

In image 4 I saved a vtp created the polydata and carry again, plus it comes
with more points than I had done previously, and also do not understand why
it.


<http://vtk.1045678.n5.nabble.com/file/n5732919/captura1.png> 
<http://vtk.1045678.n5.nabble.com/file/n5732919/captura2.png> 
<http://vtk.1045678.n5.nabble.com/file/n5732919/captura3.png> 
<http://vtk.1045678.n5.nabble.com/file/n5732919/captura4.png> 



the code I use to save him ...

vtkSmartPointer<vtkPolyData> polyData =
_vtktContourWindget()->GetContourRepresentation()->GetContourRepresentationAsPolyData();

vtkSmartPointer<vtkXMLPolyDataWriter> writer
=vtkSmartPointer<vtkXMLPolyDataWriter>::New();
writer->SetFileName(clXUteis::ConverterStringParaChar(clXUteis::CapturaPasta(DadosPaciente::id,
DadosPaciente::id2, 16, DadosSistema::caminho) +	"\\ESTUDO\\" +
DadosRequisicao::id_estudo + DadosRequisicao::id2_estudo +
"poligonos.vtp"));
writer->SetInputData(polyData);
writer->Write();



To connect the two objects I just step to the vtkRenderWindowInteractor
vtkContourWidget.




To charge I do this ...
The creation fo WindowsForms, I check in axial view if there is a polygon
for that ID if so I carry ..


GetVtkMaxilaMandibula()->GetContourWindget()->SetRepresentation(rep);
	GetVtkMaxilaMandibula()->GetContourWindget()->SetInteractor(interactor);
	GetVtkMaxilaMandibula()->GetContourWindget()->SetEnabled(true);
	GetVtkMaxilaMandibula()->GetContourWindget()->On();

	if (File::Exists(clXUteis::CapturaPasta(DadosPaciente::id,
DadosPaciente::id2, 16, DadosSistema::caminho) +
		"\\ESTUDO\\" + DadosRequisicao::id_estudo + DadosRequisicao::id2_estudo +
"poligonos.vtp"))
	{
		vtkSmartPointer<vtkXMLPolyDataReader> reader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
	
reader->SetFileName((clXUteis::ConverterStringParaChar(clXUteis::CapturaPasta(DadosPaciente::id,
DadosPaciente::id2, 16, DadosSistema::caminho) +
			"\\ESTUDO\\" + DadosRequisicao::id_estudo + DadosRequisicao::id2_estudo +
"poligonos.vtp")));
		reader->Update();
	
GetVtkMaxilaMandibula()->GetContourWindget()->Initialize(reader->GetOutput());	
	}

more then he comes this way, image 4, with more points ...





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


More information about the vtkusers mailing list