[Insight-developers] Raw file reader

kent williams norman-k-williams at uiowa.edu
Tue Oct 2 10:18:00 EDT 2007


You can, in fact.  You have to instantiate an itk::RawImageIO instance and
use itk::ImageFileReader::SetImageIO() to get the raw reader.  Then use
itk::RawImageIO::SetHeaderSize() to tell the reader how many bytes to skip
before the image data starts.  The Pixel type and Dimension of the image
type specified in the itk::ImageFileReader template instantiation determines
pixel type and dimensions of the image.

What I don¹t understand from looking in the Insight Software Guide:  You can
set the header offset explicitly, and the Pixel type and Dimensions are
derived from the itk::Image being read.  How do you tell it the image size?
Doing this sort of operation isn¹t a rare thing, and this particular corner
of ITK isn¹t that well documented anywhere,  unless I¹m totally missing it.

Faced with these issues, I¹d use a lower level solution: Since I would know
the real dimensions of the input data set, I¹d use low level file I/O (i.e.
C library functions read and write) to skip to the part of the image data I
care about, and then copy it directly into an itk::Image buffer.


On 10/2/07 3:49 AM, "CELSE Benoit" <Benoit.CELSE at ifp.fr> wrote:

> Hello 
> 
> I need to read a raw file with an 1024 o offset.
> This file is very big (more than 1,5 Go). I should them subsample it.
> May you tell me if it is possible to carry out that directly using
> itkRawImageIO ? 
> 
> Thanks in advance
> 
> Benoit 
> 
> __________________________
> 
> Ce message (et toutes ses pièces jointes éventuelles) est confidentiel et
> établi à l'intention exclusive de ses destinataires. Toute utilisation de ce
> message non conforme à sa destination, toute diffusion ou toute publication,
> totale ou partielle, est interdite, sauf autorisation expresse. L'IFP décline
> toute responsabilité au titre de ce message.
> 
> This message and any attachments (the message) are confidential and intended
> solely for the addressees. Any unauthorised use or dissemination is
> prohibited. IFP should not be liable for this message.
> 
> Visitez notre site Web / Visit our web site : http://www.ifp.fr
> __________________________
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20071002/98797d68/attachment.htm


More information about the Insight-developers mailing list