[Insight-users] i cant see image with out using vtk

H-B h4cd at yahoo.com
Thu Oct 28 05:32:15 EDT 2010


hi all, i am new ti itk 
 
the hello world run with out any problem
 
but when run data-representation example no any image displayed,just the black screen appear quickly and disappear
 
i dont know what is the problm ,, i set the file name to
reader->SetFileName( "C:\Users\Rahaf\Pictures\1.jpg");
 
because i dont know how to set parameters for argv[1] .......
 
i spent alot of time in reading and searching , at the end i try to send this message which i hope i will find answer to my questions.
 
her is the code:
 
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkGradientMagnitudeImageFilter.h"
int main( int argc, char **argv ) {
typedef itk::Image<unsigned short,2> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::GradientMagnitudeImageFilter< 
ImageType,ImageType> FilterType;
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
reader->SetFileName( "C:\Users\Rahaf\Pictures\1.jpg" );
filter->SetInput( reader->GetOutput() );
filter->Update();
return 0;
}
 
theCmakelists

PROJECT(ImageExamples)
INCLUDE_REGULAR_EXPRESSION("^.*$")
FIND_PACKAGE ( ITK)
IF ( ITK_FOUND)
INCLUDE( ${USE_ITK_FILE} )
ENDIF( ITK_FOUND)
 
ADD_EXECUTABLE(Image2 Image2.cxx )
TARGET_LINK_LIBRARIES(Image2 ITKBasicFilters ITKCommon ITKIO)
 
 


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


More information about the Insight-users mailing list