[Insight-users] Problems in reading .mhd files

Matt McCormick matt.mccormick at kitware.com
Wed Nov 21 11:14:30 EST 2012


Hi Tanweer,

The recommended method is to use CMake to generate VS2010 project
files.  This will create code that automatically registers the IO
factories.

Thanks,
Matt

On Wed, Nov 21, 2012 at 4:11 PM, Tanweer Rashid <trash001 at odu.edu> wrote:
> I have not used CMake. I am using VS2010. In the project configuration, I
> have added ITK and VTK include directories, along with the necessary VTK and
> ITK libraries and lib paths.
> I am using ITK's implementation of simplex mesh and visualizing with VTK.
> The program can create the meshes, and then visualizes them, and after that
> its seems to have trouble when it tries to read the .MHD file.
>
> - - - Tanweer Rashid
>
>
>
> On Tue, Nov 20, 2012 at 9:30 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> Are you using Cmake to configure your project? If so, please provide
>> your CMakeLists.txt file.
>>
>> If you are not using CMake, what is the reason?
>>
>> On Tue, Nov 20, 2012 at 7:31 PM, Tanweer Rashid <trash001 at odu.edu> wrote:
>> > Hi,
>> >
>> > I am having problems reading a .MHD file. I get the following error:
>> >
>> > d:\programfiles\itk\include\itk-4.2\itkimagefilereader.hxx:143:
>> >  Could not create IO object for file
>> > C:\Users\trash001\Desktop\sphere.mhd
>> >   Tried to create one of the following:
>> >   You probably failed to set a file suffix, or
>> >      set the suffix to an unsupported type.
>> >
>> >
>> > My code is as follows:
>> >
>> > typedef itk::Image<float, 3> VolumeType;
>> > typedef itk::ImageFileReader<VolumeType> VolumeReaderType;
>> >
>> > VolumeReaderType::Pointer reader = VolumeReaderType::New();
>> > reader->SetFileName("C:\\Users\\trash001\\Desktop\\sphere.mhd");
>> > reader->Update();
>> >
>> >
>> > Thanks,
>> > --
>> > Tanweer Rashid
>> > MSVE Dept.
>> > Old Dominion University
>> >
>> >
>> > _____________________________________
>> > 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://www.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-users
>> >
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>>
>> --
>> BEGIN-ANTISPAM-VOTING-LINKS
>> ------------------------------------------------------
>>
>> Teach CanIt if this mail (ID 02Iq2oiqx) is spam:
>> Spam:
>> https://www.spamtrap.odu.edu/canit/b.php?i=02Iq2oiqx&m=b645d8d1fecf&t=20121120&c=s
>> Not spam:
>> https://www.spamtrap.odu.edu/canit/b.php?i=02Iq2oiqx&m=b645d8d1fecf&t=20121120&c=n
>> Forget vote:
>> https://www.spamtrap.odu.edu/canit/b.php?i=02Iq2oiqx&m=b645d8d1fecf&t=20121120&c=f
>> ------------------------------------------------------
>> END-ANTISPAM-VOTING-LINKS
>>
>
>
>
> --
> Tanweer Rashid
> MSVE Dept.
> Old Dominion University
>
>
> _____________________________________
> 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://www.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-users
>


More information about the Insight-users mailing list