[ITK] getting RawImageIO to work

Ronn Kling ronn at rlkling.com
Wed Dec 24 14:26:10 EST 2014


I am using ITK 4.6.1, VS2010 and windows 7 64 bit. It gives this error 
on the last line in the try box



#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <afxwinforms.h>

#include "itkRawImageIO.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"

#using <mscorlib.dll>

using namespace System;
using namespace System::IO;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::Runtime::InteropServices;


int main()

{


try {
           typedef unsigned char fixedPixelType;
           typedef unsigned char movingPixelType;

           typedef itk::Image<fixedPixelType, 3> fixedImageType;
           typedef itk::Image<movingPixelType, 3> movingImageType;
           // create a ImageIO for the raw data files
           typedef itk::RawImageIO<fixedPixelType, 2> ImageIOType;
           ImageIOType::Pointer fixedimageio = ImageIOType::New();



} catch(itk::ExceptionObject & err)

         {std::cerr << "itkWrapper caught an ITK exception:\n";
         err.Print(std::cerr);
     }
}
On 12/24/2014 2:07 PM, Bill Lorensen wrote:
> Please provide a small, complete compilable example and I'm sure we can help.
>
>
> On Wed, Dec 24, 2014 at 1:14 PM, Ronn Kling <ronn at rlkling.com> wrote:
>> Hello All,
>>
>> I am trying to read in a binary data file using RawImageIO.  When I step
>> through with the debugger I get an error on the last line below about memory
>> corruption. As far as I can tell I have everything correct, what am I
>> missing?
>>
>>            typedef unsigned char fixedPixelType;
>>            typedef unsigned char movingPixelType;
>>
>>            typedef itk::Image<fixedPixelType, 3> fixedImageType;
>>            typedef itk::Image<movingPixelType, 3> movingImageType;
>>            // create a ImageIO for the raw data files
>>            typedef itk::RawImageIO<fixedPixelType, 2> ImageIOType;
>>            ImageIOType::Pointer fixedimageio = ImageIOType::New();
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/mailman/listinfo/community
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141224/e71cb8f6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cjggacai.png
Type: image/png
Size: 18047 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20141224/e71cb8f6/attachment-0001.png>


More information about the Community mailing list