<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi <br><br>I'm triying to convert an Image that I've created with itk and it pass a process to apply confidenceconected filter to vtk.<br><br>The problem is that when i see the image after the conversion it is draw the planes xz and yz in the limit of image<br><br>if we use axial view we can see the connected image ( X is supposed to be the image) and somwething like that: <br>_____ | <br> X |<br> <br><br>and i need to see the image without planes xz yz <br><br><br>here is the code if it can serve as aid<br><br> ///The application is developed in visual studio an using a GUI <br><br> const unsigned int Dimension = 3;<br><br> typedef float PixelType;<br> typedef itk::Image< PixelType, Dimension > ImageType;<br> typedef unsigned short OutputPixelType;<br> typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<br> typedef itk::CastImageFilter< ImageType, OutputImageType > CastingFilterType;<br> typedef itkMeshTovtkPolyData::TriangleMeshType MeshType;<br> typedef itk::BinaryMask3DMeshSource< OutputImageType, MeshType > MeshSourceType;<br><br> typedef itk::CurvatureFlowImageFilter< ImageType, ImageType > CurvatureFlowImageFilterType;<br> typedef itk::VTKPolyDataWriter<MeshType> WriterType;<br> typedef itk::ConfidenceConnectedImageFilter<OutputImageType, OutputImageType> ConnectedFilterType; /////COMENTAR P4<br><br> MeshSourceType::Pointer meshSource = MeshSourceType::New();<br> CastingFilterType::Pointer caster = CastingFilterType::New();<br> CurvatureFlowImageFilterType::Pointer smoothing = CurvatureFlowImageFilterType::New();<br> ConnectedFilterType::Pointer confidenceConnected = ConnectedFilterType::New();/////COMENTAR P4<br><br><br><br> ////// I have omitted the reading code of ITK <br><br><br> caster->SetInput(inputImage); <br> caster->ReleaseDataFlagOn();<br> <br> confidenceConnected->SetInput( caster->GetOutput()); <br> confidenceConnected->SetMultiplier( 2.5 ); // confMultiplier<br> confidenceConnected->SetNumberOfIterations( 1 ); //confNumIterations<br> confidenceConnected->SetReplaceValue( 180 ); //confReplaceValue<br> <br> OutputImageType::IndexType indexseed;<br> confidenceConnected->ClearSeeds();<br><br> int semillaZ=(pVO->sizeZ()-valsemz);<br> indexseed[0] = valseedx;// x<br> indexseed[1] = valseedy;// y<br> indexseed[2] = valseedz;// z<br> confidenceConnected->SetSeed( indexseed );<br> confidenceConnected->SetInitialNeighborhoodRadius( 2 ); //confRadius<br> confidenceConnected->ReleaseDataFlagOn();<br> confidenceConnected->Update();<br> <br> OutputImageType::Pointer maskImage=confidenceConnected->GetOutput(); <br> <br> ///here it is draw the planes (xz,yz) of the image limit<br> maskImage->Update();<br> meshSource->ReleaseDataFlagOn(); <br> meshSource->SetInput(maskImage);<br> meshSource->Update();<br><br> ///here we convert to vtkpolydata <br><br> vtkPolyData *vtkPolyDataOut = NULL;<br><br><br> itkMeshTovtkPolyData * itkMesh2PolyData = new itkMeshTovtkPolyData();<br> itkMesh2PolyData->SetInput (meshSource->GetOutput());<br> vtkPolyDataOut = itkMesh2PolyData->GetOutput();<br> <br> vtkCleanPolyData *pClean = vtkCleanPolyData::New();<br> pClean->SetInput(vtkPolyDataOut);<br><br> vtkDecimatePro *pDecimador = vtkDecimatePro::New();<br> pDecimador->SetInput(pClean->GetOutput());<br> pDecimador->PreserveTopologyOn ();<br> pDecimador->SetTargetReduction(.30); <br> <br> vtkSmoothPolyDataFilter *pSmoother = vtkSmoothPolyDataFilter::New();<br> pSmoother->SetInput (pDecimador->GetOutput());<br> pSmoother->SetNumberOfIterations (3);<br> pSmoother->BoundarySmoothingOff ();<br> pSmoother->FeatureEdgeSmoothingOff ();<br><br> vtkStripper * stripper = vtkStripper::New();<br> stripper->SetInput(pSmoother->GetOutput());<br> stripper->Update();<br><br> vtkPolyData *pPolyData = stripper->GetOutput();<br><br> //Here convert the vtkPolydata to my own type of visualization<br> triObject_t *obj = build3dObject (pPolyData, bInvertirCaras);<br><br><br>greetings<br>Manuel<br><br><br><br /><hr />Discover the new Windows Vista <a href='http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE' target='_new'>Learn more!</a></body>
</html>