[Insight-developers] PROPOSAL FOR IMAGEIO: class to get image attributes before reading image

Padfield, Dirk R (GE Global Research) padfield at research.ge.com
Mon Nov 25 10:33:42 EST 2013


Hi Kent,

A while ago, I wrote an ImageArchetypeReaderMex program that wraps the itkImageArchetypeImageReader as a mex function that can be called from Matlab.  I used CMake to connect ITK and Matlab, and the resulting mex file can be built on any OS and enables you to make simple imread-type calls to read any format that ITK can read into Matlab.  I can share the code I wrote for this with you if you think it would be helpful.  It may be exactly what you need, or it may include some things that could help you.

Thanks,
Dirk


Date: Thu, 21 Nov 2013 18:52:19 +0000
From: "Williams, Norman K" <norman-k-williams at uiowa.edu>
Subject: [Insight-developers] PROPOSAL FOR IMAGEIO: class to get image
        attributes before reading image
To: ITK <insight-developers at itk.org>
Message-ID: <CEB3B282.39479%norman-k-williams at uiowa.edu>
Content-Type: text/plain; charset="us-ascii"

Is there a way to do this I'm missing? There are times when it's important
to know the ITK pixel type and ImageDimension before reading an image
file.  In particular, I'm writing a reader to be called from Matlab, and
it would be good to at least create an image with the same ImageDimension
as the on-disk file.

This would (I guess) call itk::ImageIOFactory::CreateImageIO to get the
appropriate ImageIO object, then set the filename and call
itk::ImageIOFactory::ReadImageInformation.  This would work except for
multi-file images like DICOM -- the fly in everyone's ImageIO ointment.

I know how to do this; the question is where should it live? Should it be
a method of itkImageFileReader? Or its own thing?


More information about the Insight-developers mailing list