<div dir="ltr">I do this sort of thing using itk::ImageIOFactory::CreateImageIO<div><div><div><br></div><div>after using the method ReadImageInformation(), you have access to the underlying </div></div><div><br></div><div>
<br></div><div>GetComponentType(), GetPixelType(), etc.</div><div><br></div></div><div>hope that helps</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 21, 2013 at 1:52 PM, Williams, Norman K <span dir="ltr"><<a href="mailto:norman-k-williams@uiowa.edu" target="_blank">norman-k-williams@uiowa.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a way to do this I'm missing? There are times when it's important<br>
to know the ITK pixel type and ImageDimension before reading an image<br>
file. In particular, I'm writing a reader to be called from Matlab, and<br>
it would be good to at least create an image with the same ImageDimension<br>
as the on-disk file.<br>
<br>
This would (I guess) call itk::ImageIOFactory::CreateImageIO to get the<br>
appropriate ImageIO object, then set the filename and call<br>
itk::ImageIOFactory::ReadImageInformation. This would work except for<br>
multi-file images like DICOM -- the fly in everyone's ImageIO ointment.<br>
<br>
I know how to do this; the question is where should it live? Should it be<br>
a method of itkImageFileReader? Or its own thing?<br>
<br>
<br>
<br>
<br>
<br>
________________________________<br>
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.<br>
________________________________<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
</blockquote></div><br></div>