[Insight-users] writing mesh segmentation result (based on the example DeformableModel2)

amir_k kacakici at hotmail.com
Wed Aug 1 11:02:14 EDT 2012


Hello,

1) I am trying to write the output from the DeformableMesh3DFilter. My
pipeline is based on the example from DeformableModel2.cxx.

Here is what I do at the moment:

        deformableModelFilter->Update();
		qDebug() <<"Done segmenting with Deformable Model filter"<<endl;

	//write the segmented  volume in mhd file	
	typedef DeformableFilterType::OutputMeshType LabeledMeshType;

	typedef itk::ImageFileWriter<LabeledMeshType> writerType4;
	writerType4::Pointer writer4 = writerType4::New();
	writer4->SetFileName("output_DM.mhd"); //("input.mha");
	writer4->SetInput(deformableModelFilter->GetOutput());
	writer4->SetImageIO(itk::MetaImageIO::New());
	try {
		writer4->Update();
	}
	catch (itk::ExceptionObject& ex){
		qDebug()<<ex.what()<<endl;
	}

I get an error :
error C2039: 'ImageDimension' : is not a member of 'itk::Mesh<TPixelType>'
C:\Program Files\ITK\include\ITK-4.0\itkImageFileWriter.h	172


2)Otherwise, I would to visualize this by passing this segmentation output
to VTK pipeline with the reference of Seamless VTK-ITK pipeline. here are
the code lines :

        /*------------ITK to VTK pipeline connection-----------*/
	vtkKWImage *kwImage = vtkKWImage::New();
	kwImage->SetITKImageBase(deformableModelFilter->GetOutput());

		qDebug()<<"Connecting ITK pipeline to VTK pipeline"<<endl;
	
	vtkImageData *vtkImage = kwImage->GetVTKImage();


but here I get as error:
error C2664: 'vtkKWImage::SetITKImageBase' : cannot convert parameter 1 from
'itk::Mesh<TPixelType> *' to 'vtkKWImage::ImageBaseType *'	c:\Documents and
Settings\amir\Bureau\CTScan3D\CTScan3D\ctscan3d.cpp	587


Thank you for any hints.

best,
amir


-- 
View this message in context: http://old.nabble.com/writing-mesh-segmentation-result-%28based-on-the-example-DeformableModel2%29-tp34241177p34241177.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list