[Insight-users] Reading LSM images

Luis Ibanez luis.ibanez at kitware.com
Fri Feb 12 17:07:56 EST 2010


Hi Jesse,


If you have the images in independent files (one file per slice),
you should use the itk::ImageSeriesReader (instead of the
itk::ImageFileReader).


The LSM reader in ITK should be able to manage three channels
(three components per pixel).

You will find examples on how to use the ImageSeriesReader
in the ITK Software Guide

                   http://www.itk.org/ItkSoftwareGuide.pdf

in the chapter "Reading and Writing Images",

and you will find source code examples in the directory:

                           Insight/Examples/IO

in particular, you may find interesting the example:

            RGBImageSeriesReadWrite.cxx

you probably only need to replace there the PNGImageIO
class with a LSMImageIO class.


Please give it a try and let us know if you find any problems.

BTW: I you get any Exceptions, please post to the list
the *exact* error message that you get from the exception.


     Thanks



           Luis



-------------------------------------------------------------------------------------
On Fri, Feb 12, 2010 at 12:34 PM, Jesse Stokum <jessestokum at gmail.com> wrote:
> I'm trying to use ITK's ImageFileReader to read in LSM format images
> and my code is abruptly throwing exceptions. The images are three
> channel, and are ~30 slices. Should I consider them 3d images? Here's
> the code in my main() I've been trying:
>
>        typedef itk::RGBPixel<unsigned char> PixelType;
>        typedef itk::Image<PixelType, 3> ImageType;
>
>        typedef itk::ImageFileReader<ImageType> ReaderType;
>        typedef itk::LSMImageIO ImageIOType;
>        typedef itk::ImageFileWriter<ImageType> WriterType;
>
>        ReaderType::Pointer reader = ReaderType::New();
>        ImageIOType::Pointer lsmImageIO = ImageIOType::New();
>        reader->SetImageIO(lsmImageIO);
>        reader->SetFileName("Tests.lsm");
>
> Are lsm pixels vector pixels? I guess I'm just unsure how to handle
> this situation. Thanks in advance!
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list