[Insight-users] RE : BinaryMask
Yankam Njiwa Josiane Adrienne
njiwa at biomed.ee.ethz.ch
Wed May 21 08:19:47 EDT 2008
Hi Luis,
Thanks a lot for your answers. I had already read the mesh section of the itkSoftwareGuide without finding what i really need.
I try to use the option you proposed to me by writing the coordinates of the mesh into a file:
std::ofstream MyOutputFile (argv[1]);
MyOutputFile << meshSource->GetOutput() << std::endl;
I was surprised by the result because i have only one line in the output file. I checked the number of outputs with:
std::cout << meshSource->GetNumberOfOutputs() << std::endl;
The result gave 1.
Have i something wrong please in the procedure?
Regards,
Josiane.
________________________________
De: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Date: mar. 20/05/2008 16:13
À: Yankam Njiwa Josiane Adrienne
Cc: insight-users at itk.org
Objet : Re: [Insight-users] BinaryMask
Hi Josiane,
Please read the ITK Software Guide
http://www.itk.org/ItkSoftwareGuide.pdf
In particular section: 4.3 "Mesh" in pdf-page 94.
You will find examples on how to access the coordinates
of the Mesh points in page 96.
The source code example that you should look at is
Insight/Examples/DataRepresentation/Mesh/Mesh1.cxx
in particular, lines 198-224:
PointsIterator pointIterator = mesh->GetPoints()->Begin();
PointsIterator end = mesh->GetPoints()->End();
while( pointIterator != end )
{
MeshType::PointType p = pointIterator.Value();
std::cout << p << std::endl;
++pointIterator;
}
That, being said,...
Please note that if you want to proceed to perform ICP
(Iterative Closest Point), you *do not* need to manually
extract the point coordinates from the Mesh that is
produced from the BinaryMask3DMeshSource filter.
A Mesh derives from the PointSet class, and the input
to the ICP code is two PointSets. This means that you
can simply plug the Mesh as input to the ICP registration.
Something like:
registrationICP->SetFixedPointSet(
binaryMask3DMeshSource->GetOutput() );
Regards,
Luis
-----------------------------
Yankam Njiwa Josiane Adrienne wrote:
>
> Dear all,
>
> I am back with another problem. I ran the test example itkBinaryMask3DMeshSourceTest.cxx, after it i have the number of cells and nodes of the mesh. My question is about a speciific image: How can i create and get the coordinates of mesh by presenting in entry a binary image? My aim is to use these point coordinates in the iterative closestPoint registration framework.
>
> Could somebody give me some help please?
>
> Regards,
>
> Josiane.
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list