[Insight-users] File IO ITK

Andreas Schuh andreas.schuh.84 at googlemail.com
Thu Mar 5 01:41:57 EST 2009


Hi Wen Shi,

the IO filters try to derive the file type specific ImageIO subclass  
from the filename extension. As your file has no extension, the IO  
filters have no idea which ImageIO subclass to use. You could either  
rename your mhd file that it has the extension .mhd or you specify the  
ImageIO class to use explicitly by SetImageIO() of the IO filters  
(ImageFileReader in your case). For mhd files, the appropriate ImageIO  
subclass is MetaImageIO.

--
regards
Andreas

Am 05.03.2009 um 06:57 schrieb Wen Shi <wsa18 at sfu.ca>:

> Hi Guys,
>
>
> I just have a question about file IO.
> How to specify the image file you want to process in the code?
> In softwareGuide C4 it says
> reader->SetFileName(filename);
> Then I tried to set the filename to be the one  I want to process  
> like "raw_mhd", I put the image file in the same directory as the  
> source files.
> But the program doesn't recognize it, the error is
> Could not create IO object for file raw_mhd.
>
> Is there anything I need to address before assign the file name to  
> SetFile()?
> Thanks a lot
>
> Wen Shi
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> 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-users


More information about the Insight-users mailing list