[Insight-users] Reading series of images

Toon Huysmans denhuys at hotmail.com
Fri, 9 Apr 2004 16:15:11 +0200


Ah that clears things out, thank you!

Toon.


----- Original Message ----- 
From: "Miller, James V (Research)" <millerjv at crd.ge.com>
To: "'Toon Huysmans'" <denhuys at hotmail.com>; <insight-users at itk.org>
Sent: Friday, April 09, 2004 4:03 PM
Subject: RE: [Insight-users] Reading series of images


> Files are queried multiple times when read.
>
> First there is pass via the factor mechanism to determine which type
> of format the file is.  A set of ImageIO each peek at the file and
> determine whether the file is a format it can read. In simple cases,
> we simply trigger off the extension.  But usually, the ImageIO objects
> look for a magic number of try to read the complete header to determine
> whether the file is a format it can read.
>
> Once an ImageIO is found that can read the file, the reader will read the
> file's  meta data.  This a subset of the information that is usually in
the
> header of file.  Things like pixel type, rows and columns, etc.
>
> Finally, the bulk data (pixel data) is read.
>
> I suspect you are seeing the filenames once for meta-information and once
> for the bulk data.
>
>
>
> -----Original Message-----
> From: Toon Huysmans [mailto:denhuys at hotmail.com]
> Sent: Friday, April 09, 2004 9:12 AM
> To: insight-users at itk.org
> Subject: Re: [Insight-users] Reading series of images
>
>
> Hello Luis,
>
>     I am reading a mhd file, refering to slices in BMP format.
>
>     I only suspect that the slices are read twice, I don`t any code that
> acknowledges that.
>     But when reading such a mhd file, using itk::ImageFileReader, the
> file-name of each slice is output to the console.
>     And since the series of slide-filenames is output twice, I suspect the
> that the slices are read twice.
>
>
>         typedef itk::ImageFileReader<ImageType> ReaderType;
>         ReaderType::Pointer reader = ReaderType::New();
>         const char *filename = "F:/thing.mhd";
>         reader->SetFileName( filename );
>         reader->Update();
>
> Hope I am specific enough,
> Thanks,
>
> Toon.
>
>
> ----- Original Message ----- 
> From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "Toon Huysmans" <denhuys at hotmail.com>
> Cc: <insight-users at itk.org>
> Sent: Friday, April 09, 2004 2:33 PM
> Subject: Re: [Insight-users] Reading series of images
>
>
> >
> > Hi Toon,
> >
> >
> > Could you please be more specific with your question ?
> >
> >
> > By   "ImageReader", do you mean:
> >
> > A) the class itk::ImageFileReader   ?
> >
> >     or
> >
> > B) one of the examples in Insight/Examples/IO
> >
> >     or
> >
> > C) something else ?
> >
> >
> >
> > Also, what make you suspect that slices are being
> > read twice ?  are you running this in a debugger ?
> > and seeing twice the invokation of a particular function ?
> > if so, what function do you see invoked twice ?
> >
> >
> > Can you post a minimal code example where you
> > observe such behavior ?
> >
> > What image fileformat where you reading when you
> > noticed such effect  ?
> >
> >
> >
> >    Thanks,
> >
> >
> >      Luis
> >
> >
> > --------------------
> > Toon Huysmans wrote:
> >
> > > Hi,
> > >
> > >     I`ve got q small question:  Why does ImageReader seem to read
every
> > > slice two times.  In a first pass, the images are read in slow, the
> > > second pass is fater. any ideas?
> > >
> > > Toon.
> >
> >
> >
> >
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>