[Insight-users] i can't read image with itk

Syrine Sahmim syrine.sahmim at yahoo.fr
Wed Jun 17 03:11:05 EDT 2009


Hello,
I'm a new user of ITK.
I succeed to install it and run it on c++.
I won't to read  dicom image and display it on screen at the begining.i tried the examples included on itk/example but i have many errors when i debogue the program.the build is successful.I have tried for many days but i can't debogue it . i have send many times to the forum but i don't reseived any answer. 
can somebody help me
Thanks


the c make file is as follow:
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
IF(COMMAND CMAKE_POLICY)
  CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)

PROJECT(ImageExamples)
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
INCLUDE_REGULAR_EXPRESSION("^.*$")

SET(TEMP ${ITK_BINARY_DIR}/Testing/Temporary)

ADD_EXECUTABLE(Image2 Image2.cxx )
TARGET_LINK_LIBRARIES(Image2 ITKIO)

SET(IMAGE_EXAMPLES2 ${CXX_TEST_PATH}/ImageExamples2)
IF( NOT ITK_DISABLE_CXX_TESTING )

IF(BUILD_TESTING)

IF(NOT BORLAND)
  ADD_TEST(Image2Test ${IMAGE_EXAMPLES}
    Image2Test ${ITK_SOURCE_DIR}/Examples/Data/BrainMidSagittalSlice.png
  )
ENDIF(NOT BORLAND)
ENDIF(BUILD_TESTING)
ENDIF( NOT ITK_DISABLE_CXX_TESTING )

and the image2.cxx file is :
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkImage.h"
#include "itkImageFileReader.h"
int main( int , char * argv[])
{typedef unsigned char          PixelType;
  const unsigned int             Dimension = 3;

  typedef itk::Image< PixelType, Dimension >   ImageType;
typedef itk::ImageFileReader< ImageType >  ReaderType;
ReaderType::Pointer reader = ReaderType::New();
const char * filename = argv[1];
  reader->SetFileName( filename );
reader->Update();
ImageType::Pointer image = reader->GetOutput();
 return 0;}


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


More information about the Insight-users mailing list