[Insight-users] MetaIO - problems reading a stack of PNG imag es

Stephen R. Aylward aylward@unc.edu
Sun, 16 Mar 2003 11:06:40 -0500


Ron Inbar wrote:
 > Stephen,
 >
 >
 >>1) Read your data in as a series of 2D slices using itk's png reader and
 >>then composite them into a 3D volume.
 >
 >
 > How do you do that?
 >
 > Ron

Hi,

Right now there is not an automated mechanism for this in ITK.   But one 
should be ready by October.   That routine will allow any set of 2D 
slices to be read into a 3D volume.

I really recommend converting your slices to raw and then using 
MetaImage.  That way you can record and read-in slice thickness, voxel 
spacing, voxel type, etc.   PNG format does not support this type of 
info and it is critical to medical image analysis - MetaImage, Analyze, 
Gipl, and others support such info.

In the meantime, the following is pseudo code....not even close to 
something that compiles, but if you want to read in 2D PNG's into a 3D 
volume, do somthing like

Image2D::iterator it2D;
Image3D::iterator it3D;
it3D = it3D.begin();
for i=1 to numberOfSlices
  BEGIN
   img2D = read2D(sliceFileName[i]);
   it2D = it2D.begin();
   for(it2D=it2D.begin(); it2D != it2D.end(); it2D++,it3D++)
          MOVE (*it2D) TO (*it3D)         :)   (*it3D) = (*it2D);
  END


Stephen

Ron Inbar wrote:
> Stephen,
> 
> 
>>1) Read your data in as a series of 2D slices using itk's png reader and
>>then composite them into a 3D volume.
> 
> 
> How do you do that?
> 
> Ron
> 
>  
> 
> This e-mail message has been sent by MediGuide
> and is for the use of the intended recipients only.
> The message may contain privileged or confidential information .
> If you are not the intended recipient you are hereby notified that any use,
> distribution or copying of this communication is strictly prohibited,
> and you are requested to delete the e-mail and any attachments
> and notify the sender immediately.


-- 
===============================================
Dr. Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://caddlab.rad.unc.edu
aylward@unc.edu
(919) 966-9695