[Insight-users] Reading series of images

Luis Ibanez luis.ibanez at kitware.com
Fri, 09 Apr 2004 11:42:02 -0400


Hi Toon,

A bug was recently fixed in the MetaImage reader
that was causing the images to be read twice.

If you are using an ITK version that is older than
four weeks, you may want to update to the current
CVS version.

Otherwise,
the effect may be due to what Jim explained: the
fact that the files are tested first just to see
whether the ImageIO reader is capable of reading
the file or not, and then a second time for actually
reading the data.



   Regards,


     Luis


--------------------
Toon Huysmans wrote:
> 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
>