[ITK] [ITK-users] 4D Image to Matrix inside mask
Javier Juan Albarracín
javij1 at gmail.com
Thu May 5 05:48:24 EDT 2016
Hello,
I have a 4D image, which is a DSC Perfusion weighted MRI. Supose the
image has the dimenisions 270x270x171x34. I want to convert this image
into a Matrix of size Nx34, where N are the number of voxels inside the
intracraneal mask. The Matrix class comes from Eigen library. In a
classic "for loop" scheme the code would be
for (int x = 0; x < image.width(); x++)
{
for (int y = 0; y < image.height(); y++)
{
for (int z = 0; z < image.depth(); z++)
{
if (!mask(x, y, z))
continue;
for (int c = 0; c < image.spectrum(); c++)
Matrix(i, c) = image(x, y, z, c);
i++;
}
}
}
How can I do this in ITK?? I have read several ImageRegionIterator
examples, but I do not find a clean and correct way to do what I want.
Thank you very much.
Regards.
Javier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160505/4767f272/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list