[Insight-users] Re: ITK LSM READER

Daniel Mace dlm19 at duke.edu
Tue Dec 12 00:43:28 EST 2006


Gaetan,

Thanks for the suggestion, it worked great.  I ended up bypassing the 
whole itkvtk convert filters by wrapping a filter directly around the 
vtkLSMReader class and having it pass back a 5 dimensional ITK image 
(x,y,z,time,channel).  It's a bit clumsy right now, but saves me from 
having to rewrite the itkLSMReader class ;) (which was a rather daunting 
task).

Cheers,
Dan

Gaëtan Lehmann wrote:
>
> Hi Daniel,
>
> The code I'm using is available at 
> http://voxel.jouy.inra.fr/darcs/contrib-itk/WrapITK-unstable/ExternalProjects/ItkVtkGlue/Wrapping/Python/itkExtras/itkvtkExtras.py 
> and is in python.
>
> You can't convert a color image directly, but you can pass the images 
> one by one, and recreate a colored image if you want in ITK.
>
> Kalle and Dan are working on the BioImageXD project where this code 
> come from. They should be able to say better than me what their reader 
> is able to do :-)
>
> Gaetan
>
> Le Sat, 09 Dec 2006 02:26:03 +0100, Daniel Mace <dlm19 at duke.edu> a écrit:
>
>> Well, it seems that there really is no way to convert anything more 
>> than a 3D image back into ITK.  I started to rewrite the 
>> itkVTKImageImport class to extend to more than 3 dimensions when I 
>> realized that the 3D limitation is hard coded all the way through the 
>> vtk code as well.  Ohh well, good motivation to fix the itkLSMImageIO 
>> channel issue I guess.
>>
>> Cheers,
>> Dan
>>
>> Daniel Mace wrote:
>>> Gaeten,
>>>
>>> Could you post your code for using the vtkLSMReader and converting 
>>> it into the ITK framework?  My problem seems to be with the 
>>> ImageType parameters that the vtkLSMReader is outputing.  The LSM 
>>> image I am trying to read is a 4 Dimensional image with two channels 
>>> (x * y * x_tiling * y_tiling).  I've tried setting my 
>>> itkVTKImageToImageFilter to a 4D Image with pixel type of Vector (2 
>>> and 3 dimensional vectors, neither worked), and also as a 5D image, 
>>> and as a VectorImage to no avail (it seems that the 
>>> itkVTKImageToImageFilter does not like VectorImages).  BioImageXD 
>>> correctly reads the LSM file and sets it to it's correct settings 
>>> for viewing, so I'm guessing my issue is with my templating of the 
>>> itkVTKImageToImageFilter.
>>>
>>> I can send you the LSM file I am trying to read if that would help.
>>>
>>> Cheers,
>>> Dan
>>>
>>> Gaetan Lehmann <gaetan.lehmann at ...> writes:
>>>
>>> >
>>> >
>>> > Hi,
>>> >
>>> > LSM reader doesn't seem to be fully functional in ITK. The last 
>>> time I  > tried it, I was able to read an lsm file only if it 
>>> contains a single  > channel.
>>> >
>>> > You should prefer the very good vtkLSMReader developed for 
>>> BioImageXD. I'm  > using it daily, and it works perfectly.
>>> >
>>> > 
>>> http://svn.sourceforge.net/viewvc/bioimagexd/bioimagexd/trunk/C%2B%2B/
>>> > http://modeling.bio.jyu.fi:8080/bioimagexd
>>> >
>>> > Gaetan
>>> >
>>> > On Thu, 19 Oct 2006 15:08:29 +0200, Manuss <mac.manuss at ...> wrote:
>>> >
>>> > >   Hello,
>>> > > I  try to convert the LSM files (Zeiss) to VTK file format.
>>> > >
>>> > > I had a look on the different Library of VTK/ITK
>>> > > and i saw that on ITK->Code->IO, there is a file call itkLSMImageIO
>>> > > (.h and .cxx) which read a LSM file.
>>> > > But i have a problem when i read the LSM file and save it in a VTK
>>> > > format, it saves only the first image of the stack.
>>> > > It create all the different images in z and make a VTK matrix with
>>> > > all this stack, but only the first image on this stack is written,
>>> > > the other are all black ...
>>> > > Have you got an Idea, i think it's a problem of the reader.
>>> > >
>>> > >
>>> > >
>>> > > I use the file itkLSMImageIOTest.cxx
>>> > >
>>> > >
>>> > >    typedef itk::RGBPixel< unsigned char >   InputPixelType;
>>> > >    typedef itk::Image< InputPixelType, 3 > InputImageType;
>>> > >    typedef itk::ImageFileReader< InputImageType > ReaderType;
>>> > >    typedef itk::LSMImageIO ImageIOType;
>>> > >
>>> > >    ReaderType::Pointer reader = ReaderType::New();
>>> > >    reader->SetFileName( filename );
>>> > >
>>> > >    ImageIOType::Pointer lsmImageIO = ImageIOType::New();
>>> > >    reader->SetImageIO( lsmImageIO );
>>> > >
>>> > >    reader->Update();
>>> > >
>>> > >
>>> > >    typedef itk::ImageFileWriter< InputImageType >  WriterType;
>>> > >    WriterType::Pointer writer = WriterType::New();
>>> > >    writer->SetFileName( outfilename );
>>> > >    writer->SetInput( reader->GetOutput() );
>>> > >
>>> > >    writer->Update();
>>> > >
>>> > > lsmImageIO->Print(std::cout);
>>> > >
>>> >
>>>
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
> --Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr



More information about the Insight-users mailing list