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

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Nov 21 14:18:58 EST 2013


This is how I do it in SimpleITK:
https://github.com/SimpleITK/SimpleITK/blob/master/Code/IO/src/sitkImageReaderBase.cxx#L45

Although I don't expose the ability to get this information before reading the image. That is something I'd like to be there.

I think the current mechanisms works OK, since the ImageIO is just the holder of all the meta data. Not sure what an alternative at the ITK level would be?

Brad

On Nov 21, 2013, at 1:52 PM, "Williams, Norman K" <norman-k-williams at uiowa.edu> wrote:

> 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?
> 
> 
> 
> 
> 
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> ________________________________
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Community mailing list