Hi All,

My algorithm has just generated a wonderful scalp extraction from T1 MRI
image.
Now, I'm dealing with an irritating problem: that surface has been shifted
as seen in the attachment.
How can I overcome that?

Flow chart of my conversions:
itk_Image => mitk_Image => vtk_Image => vtkPolyData

Snap code:

    //some manipulations on itk image
    mitk::CastToMitkImage(itk_Image, mitk_Image);

    vtkImageData* vtkImage = vtkImageData::New();
    vtk_Image = mitk_Image->GetVtkImageData();

    // smoothing
    vtkImageGaussianSmooth* smooth    = vtkImageGaussianSmooth::New();
    vtkImageMedian3D* med = vtkImageMedian3D::New();
    smooth->SetInput(vtkImage);
    med->SetInput(smooth->GetOutput());
    med->SetKernelSize(3,3,2);

    // conversion to vtk poly data
    vtkContourFilter* image2poly =    vtkContourFilter::New();
    image2poly->SetInput ( (vtkDataSet*)med->GetOutput());
    image2poly->SetValue(0,1);

    // pick the largest component
    vtkPolyDataConnectivityFilter* connectivity =
 vtkPolyDataConnectivityFilter::New();
    connectivity->ScalarConnectivityOff();
    connectivity->SetExtractionModeToLargestRegion();
    connectivity->SetInput(image2poly->GetOutput());

    // in order to view my output surface on mitk gui
    mitk::Surface::Pointer outputSurface::Surface::New();
    outputSurface->SetVtkPolyData(connectivity->GetOutput());
    outputSurface->Update();

    vtkPolyDataWriter* writerPD = vtkPolyDataWriter::New();
    writerPD->SetInput(connectivity->GetOutput());
    writerPD->SetFileName("Surface.vtk");
    writerPD->SetFileTypeToASCII();
    writerPD->Write();

<<attachment: surface.JPG>>

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to