<div>Hello,</div> <div> </div> <div>I am a beginner in ITK toolkit. Could someone tell me how to take DICOM images as input and view it through VTK. The could below is what i have used. But somehow the image is not read and a windows error comes as</div> <div>" <B><FONT size=1></div> <div>program.exe has encountered a problem and needs to close. We are sorry for the inconvenience.</div></B></FONT> <div>"</div> <div>The next error is "Debug assertion failed...." . Is the code written below right??</div> <div> </div> <div># include "itkImage.h"<BR># include "itkImageFileReader.h"<BR># include "itkImageToVTKImageFilter.h"</div> <div># include "vtkImageViewer.h"<BR># include "vtkRenderWindowInteractor.h"<BR># include "itkGDCMImageIO.h"</div> <div>int main(int argc, char **argv)<BR>{<BR> typedef itk::Image<unsigned short,2> ImageType;<BR> typedef itk::ImageFileReader<ImageType> ReaderType;<BR> typedef
itk::ImageToVTKImageFilter<ImageType> ConnectorType;</div> <div> <BR> ReaderType::Pointer reader = ReaderType::New();<BR> ConnectorType::Pointer connector = ConnectorType::New();</div> <div> <BR> reader->SetFileName(argv[1]);</div> <div> typedef itk::GDCMImageIO ImageIOType; <BR> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();<BR> reader->SetImageIO(gdcmImageIO);</div> <div> try<BR> {<BR> reader->Update();<BR> }<BR> catch(itk::ExceptionObject & e)<BR> {<BR> std::cerr <<"exception in file reader "<<std::endl;<BR> std::cerr<<e<<std::endl;<BR> return EXIT_FAILURE;<BR> }</div> <div> connector->SetInput(reader->GetOutput());</div> <div> </div> <div> vtkImageViewer *viewer = vtkImageViewer::New();<BR> vtkRenderWindowInteractor *renderWindowInteractor =
vtkRenderWindowInteractor::New();<BR> <BR> viewer->SetupInteractor(renderWindowInteractor);<BR> viewer->SetInput(connector->GetOutput());<BR> <BR> viewer->Render();<BR> viewer->SetColorWindow(255);<BR> viewer->SetColorLevel(128);<BR> renderWindowInteractor->Start();<BR> return 0;</div> <div> <BR>}</div> <div> </div> <div> </div> <div>Thanks,</div> <div>Brian</div><p> 
                <hr size=1>Do you Yahoo!?<br> Everyone is raving about the <a href="http://us.rd.yahoo.com/evt=42297/*http://advision.webevents.yahoo.com/mailbeta"> all-new Yahoo! Mail.</a>