[Insight-users] Can't see result imae from ImageReadWrite

Ella Maria Kadas ella_kadas at yahoo.com
Fri Feb 25 04:15:07 EST 2011


Hi Gib,

I would have expected some errors if the image format was not accepted.
First i Dont have anything in Project PropertiesConfiguration Properties > Linker 
> General > Additional Library Directories shows:
"C:\Program Files\VTK\lib\vtk-5.4\$(OutDir)","C:\Program 
Files\VTK\lib\vtk-5.4",D:\ITK\bin\$(OutDir),D:\ITK\bin


In my environment variables, I have set:
ITK_DIR=D:\Toolbox\ITK3.20 Btu i don't know what path do u mean by" ITK appears is in the path, where I have
C:\Program files\ITK\bin"

This is really driving me crazy. Even more because building ITK or VTK takes 6,7 hours on PC. At work i am programing on a mac, so it is a different story, and i am trying to do all this because i can't manage to use GeodesicActiveContour filter, nor ChanVese properly on some MRT images for a plugin in Osirix, so i would like to see if it is something related to Osirix or not.Hope i will manage to make it work soon,Thanks ,Ella
--- Gib Bogle <g.bogle at auckland.ac.nz> schrieb am Fr, 25.2.2011:

Von: Gib Bogle <g.bogle at auckland.ac.nz>
Betreff: Re: Can't see result imae from ImageReadWrite
An: "Ella Maria Kadas" <ella_kadas at yahoo.com>
CC: "John Drescher" <drescherjm at gmail.com>, insight-users at itk.org
Datum: Freitag, 25. Februar, 2011 10:51 Uhr

Hi Ella,

I wonder if that could be an issue of file formats supported by ITK, although 
I'd expect to see an ITK error message.  The code works for me, anyway.

Have you tried building it as I did?  Mind you, I'm using Visual Studio 8 2005.

Gib

On 25/02/2011 8:20 p.m., Ella Maria Kadas wrote:
> Hi Gib,
>
> I managed to build ITK, VTK, and run the ImageReadWrite.cxx.
> It seems that the folder structure suggested by John Drescher worked for me.
> I still get a First-chance exception at 0x7c812afb in ImageReadWrite.exe:
> Microsoft C++ exception: itk::ExceptionObject at memory location 0x0137f6b8..
> The program '[3412] ImageReadWrite.exe: Native' has exited with code 1 (0x1).
> I googled it and it seems to be a a notification to the debugger so it can stop
> the program.
> But i still can't see the result image. My image is a gray scale jpeg 164x120
> Here is my code:
> #if defined(_MSC_VER)
> #pragma warning ( disable : 4786 )
> #endif
>
> #ifdef __BORLANDC__
> #define ITK_LEAN_AND_MEAN
> #endif
>
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkImage.h"
>
>
> int main( int argc, char ** argv )
> {
>
>
> typedef short PixelType;
> const unsigned int Dimension = 2;
> typedef itk::Image< PixelType, Dimension > ImageType;
> typedef itk::ImageFileReader< ImageType > ReaderType;
> typedef itk::ImageFileWriter< ImageType > WriterType;
>
> ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
>
> const char * inputFilename = "bla.jpg";
> const char * outputFilename = "bla2.jpg";
>
> reader->SetFileName( inputFilename );
> writer->SetFileName( outputFilename );
>
> try
> {
> writer->Update();
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return EXIT_FAILURE;
> }
>
> return EXIT_SUCCESS;
> }
> Cheers,
> Ella
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110225/62870135/attachment.htm>


More information about the Insight-users mailing list