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

Stuart Golodetz itk at gxstudios.net
Thu Oct 28 08:40:38 EDT 2010


Hi H-B,

You're reading in the image and running it through a 
GradientMagnitudeImageFilter, but then you're not actually doing 
anything with it -- it's therefore not surprising that the image isn't 
being displayed (you never wrote the code to display it). The key point 
to bear in mind is that ITK is an *image processing* toolkit, not a 
*visualization* toolkit (that's what VTK is for). If you want to 
visualize things, you either have to use VTK, or visualize the image 
some other way (for instance, the way I do it in my code is to create 
OpenGL textures from the images and render texture-mapped polygons to 
visualize them). Just loading in the image isn't enough -- all that does 
is read the image into memory.

Hope that helps!
Stu

On 28/10/2010 10:32, H-B wrote:
> 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:
> #ifdefined(_MSC_VER)
> #pragmawarning( disable: 4786 )
> #endif
> #include"itkImage.h"
> #include"itkImageFileReader.h"
> #include"itkGradientMagnitudeImageFilter.h"
> intmain( intargc, char**argv ) {
> typedefitk::Image<unsignedshort,2> ImageType;
> typedefitk::ImageFileReader<ImageType> ReaderType;
> typedefitk::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();
> return0;
> }
> 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)
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101028/389b44b9/attachment.htm>


More information about the Insight-users mailing list