[Insight-users] Reading MHD/RAW problem
Bill Lorensen
bill.lorensen at gmail.com
Wed Sep 16 11:05:00 EDT 2009
I suspect this is a ^M problem with your .mhd file. Do you have the
program: dos2unix on your system. If so, please run it on your .mhd
file and try again. If not, get a copy of dos2unix. For example, here
is one version:
http://www.freedownloadscenter.com/Utilities/Misc__Utilities/DOS2UNIX_UNIX2DOS.html
Bill
On Wed, Sep 16, 2009 at 10:47 AM, <itkvtk123 at gmx.net> wrote:
> I'm using Visual Studio 2008 (Version 9.0) Professional Edition with ITK 3.14 on Windows XP SP3.
>
> Again my entire code:
>
> #include <fstream>
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkImage.h"
>
> int main()
> {
> // ATTENTION THIS IS THE PIXEL TYPE FOR
> // THE RESULTING IMAGE
> typedef unsigned short PixelType;
> typedef itk::Image<PixelType, 3> myImage;
>
> itk::ImageFileReader<myImage>::Pointer reader = itk::ImageFileReader<myImage>::New();
>
> reader->SetFileName("C:/LungConeBeam.mhd");
> try
> {
> reader->Update();
> }
> catch (itk::ExceptionObject & e)
> {
> std::cerr << "exception in file reader " << std::endl;
> std::cerr << e << std::endl;
> }
>
> myImage::Pointer image = reader->GetOutput();
> image->Print(std::cout );
>
> myImage::RegionType region = image->GetLargestPossibleRegion();
> std::cout << "region " << region;
>
> system("pause");
> return EXIT_SUCCESS;
> }
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> _____________________________________
> 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