[Insight-users] How to read some RGB png files as a volume

Luis Ibanez luis.ibanez at kitware.com
Mon, 29 Dec 2003 10:50:55 -0500


Hi Songtao,

A new example was just added to the toolkit for
illustrating how to use the ImageSeriesReader
for loading a set of 2D slices from PNG files
and use them to compose a 3D image.

You will find this new example under

  Insight/Examples/Code/IO
            RGBImageSeriesReadWrite.cxx

http://www . itk . org/cgi-bin/cvsweb . cgi/Insight/Examples/IO/RGBImageSeriesReadWrite . cxx?cvsroot=Insight&sortby=date

The example shows how to combine the ImageSeriesReader
with the NumericSeriesFileNames (filename generator).

You can use this example as a command line program.

In your case you will have to modify the string format
to be something like:

                 "XXX.%d.png"

A similar example was added for reading slices from
grayscale PNG files. This other example is available
as

  Insight/Examples/Code/IO
              ImageSeriesReadWrite.cxx



Please let us know if you have any further questions,


  Thanks


    Luis



------------------------------------
宋涛 wrote:

> Hi luis,
> 
> Thank you for you advices about how to use VectorConfidenceConnectedImageFilter.
> 
> Now I have a new question!
> 
> I have some RGB png files named with
> 
> XXX.1.png
> XXX.2.png
> ...
> 
> I want to read them as a volume. So I define below: 
> 
> 	typedef itk::Image< PixelType, 3 >   ImageType;
> 	typedef itk::ImageFileReader< ImageType >  ReaderType;
> 
> 	ReaderType::Pointer reader = ReaderType::New();
> 	reader->SetFileName(  );<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 	reader->Update();
> 
> But I don't konw How to set SetFileName;
> 
> Hope your advices soon! Thank you!
> 
> 
> songtao
> ========================================================
> 网易VIP收费邮箱两周年超值优惠! 满1赠6!!           http://vip . 163 . com
> 
> 中国最大的免费邮箱在等你 25兆空间4兆附件!      http://mail . 163 . com
> 
> 点击网易泡泡惊喜无限 全免费手机短信任你发!      http://popo . 163 . com
> "{"n标鞕ē妜%娝H炄爢郜z"禞+m鹈瓛娻?f?X)撸(!峨rs==