<HTML><BODY>I change the part of my programm to load the ImageSeries,<br><br>    typedef itk::Image<unsigned char, 3> ImageType;<br>    typedef itk::ImageSeriesReader< ImageType >  ReaderType;<br>    ReaderType::Pointer reader = ReaderType::New();<br>    typedef itk::GDCMImageIO ImageIOType;<br>    ImageIOType::Pointer dicomIO = ImageIOType::New();<br>    reader->SetImageIO(dicomIO);<br><br>    typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br>    NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<br>    nameGenerator->SetDirectory("Folder");<br><br><br>    // get series IDs<br>    typedef std::vector<std::string> SeriesIdContainer;<br>    const SeriesIdContainer &seriesUID = nameGenerator->GetSeriesUIDs();<br><br>    // get dicom series<br>    typedef std::vector<std::string> FileNamesContainer;<br>    FileNamesContainer fileName;<br>    fileName=nameGenerator->GetFileNames(seriesUID.begin()->c_str());<br>    reader->SetFileNames(fileName);<br><br>    // pull reader<br>    reader->Update();<br><br>But my programm crash again at the same position, when i try to convert to vtk.<br><br><br>Sat, 26 Apr 2014 07:12:55 +0800 (CST) от 关红彦 <ghy@tellyes.com>:<br>
<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        <div id="">
        



    









        
        


        
        
        
        
        

        
        

        
        



<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div>
                <base target="_self" href="https://e.mail.ru/">
                
                        <div id="style_13984675800000000762_BODY"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><br><br>I just wonder if your 3D medical images save as a file or a series of images.<div>If you save  them to a series of files,  you shouldn't  do this: </div><div style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> </span><span style="font-family: monospace;font-size: 12px;line-height: 22px;color: rgb(255, 0, 0);">#include <</span><a href="http://www.itk.org/Doxygen45/html/itkImageFileReader_8h_source.html" style="color: rgb(255, 0, 0);font-weight: bold;text-decoration: none;font-family: monospace;font-size: 12px;line-height: 22px;" target="_blank">itkImageFileReader.h</a><span style="font-family: monospace;font-size: 12px;line-height: 22px;color: rgb(255, 0, 0);">></span></div><div><span style="color: rgb(255, 0, 0);">reader->SetFileName( "DICOM-File" );</span> <span style="color: rgb(255, 0, 0);"></span></div><div><font color="#ff0000"><br></font></div><div><font style="color: rgb(0, 0, 0);" color="#ff0000">but this:</font></div><div><span style="font-family: monospace;font-size: 12px;line-height: 22px;"></span><span style="color: rgb(0, 0, 255);"><span style="font-family: monospace;font-size: 12px;line-height: 22px;color: rgb(0, 0, 255);">#include <</span><a href="http://www.itk.org/Doxygen45/html/itkImageSeriesReader_8h_source.html" style="color: rgb(0, 0, 255);font-weight: bold;text-decoration: none;font-family: monospace;font-size: 12px;line-height: 22px;" target="_blank">itkImageSeriesReader.h</a><span style="font-family: monospace;font-size: 12px;line-height: 22px;color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 255);"> </span><font color="#ff0000"><br></font><table class="mceItemTable" style="font-size: 12px;line-height: 22px;font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif;border-spacing: 0px;padding: 0px;color: rgb(0, 0, 0);text-align: start;"><tbody><tr><td style="background-color: rgb(249, 250, 252);border: none;margin: 4px;padding: 1px 0px 0px 8px;white-space: nowrap;-webkit-transition: background-color 0.5s, box-shadow;color: rgb(0, 0, 255);" align="right" valign="top">void </td><td style="background-color: rgb(249, 250, 252);border: none;margin: 4px;padding: 1px 0px 0px 8px;width: 1607px;-webkit-transition: background-color 0.5s, box-shadow;" valign="bottom"><a href="http://www.itk.org/Doxygen45/html/classitk_1_1ImageSeriesReader.html#aedb3ea58c4bb4975f46ef9c85a855aa6" style="color: rgb(0, 0, 255);font-weight: bold;text-decoration: none;" target="_blank">SetFileNames</a><span style="color: rgb(0, 0, 255);"> (const </span><a href="http://www.itk.org/Doxygen45/html/classitk_1_1ImageSeriesReader.html#a2efd0b86373c161229f7984b9ea4af56" style="color: rgb(0, 0, 255);font-weight: bold;text-decoration: none;" target="_blank">FileNamesContainer</a><span style="color: rgb(0, 0, 255);"> &name)</span></td></tr></tbody></table></span><table class="mceItemTable" style="font-size: 12px;line-height: 22px;font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif;border-spacing: 0px;padding: 0px;color: rgb(0, 0, 0);text-align: start;"><tbody><tr><td style="background-color: rgb(249, 250, 252);border: none;margin: 4px;padding: 1px 0px 0px 8px;width: 1607px;-webkit-transition: background-color 0.5s, box-shadow;" valign="bottom"></td></tr></tbody></table>This class can read a series of *.DCM files that are using a lot in the hospital.<br><div><br></div><br>At 2014-04-25 20:52:20,"Роман Глуховский" <roman_glu@mail.ru> wrote:<br> <blockquote style="padding-left: 1ex;margin: 0px 0px 0px 0.8ex;border-left: #ccc 1px solid">Hi vtkusers,<br><br>i load a DICOM-file with itk and after that i would like to display the file with vtk. <br><br>If I compile the programm I have no error. When i start the programm, its crashed and <br>i get a return value "0".<br><br>In the debug-mode i get a "segmentation fault" and the programm stops at this position<br><br>----------> m_Importer->SetPropagateUpdateExtentCallback(m_Exporter->GetPropagateUpdateExtentCallback());<br><br>in the "itkImageToVTKImageFilter_hxx". <br><br>Here is my code:<br><br>        typedef itk::Image<unsigned char, 3> VisualizingImageType;<br>        typedef itk::ImageFileReader< VisualizingImageType >  ReaderType;<br>        ReaderType::Pointer reader = ReaderType::New();<br>        reader->SetFileName( "DICOM-File" );<br>        typedef itk::GDCMImageIO ImageIOType;<br><br>        ImageIOType::Pointer gdcmImageIO = ImageIOType::New();<br><br>        reader->SetImageIO( gdcmImageIO );<br>        reader->Update();<br>        reader->GetOutput()->Print(std::cout);<br><br>        vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();<br>        vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New();<br>        ren1->SetBackground(0.5f,0.5f,1.0f);<br><br>        renWin->AddRenderer(ren1);<br>        renWin->SetSize(1280,1024);<br>        vtkSmartPointer<vtkRenderWindowInteractor> iren =<br>            vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>        iren->SetRenderWindow(renWin);<br>        renWin->Render(); // make sure we have an OpenGL context.<br><br>        typedef itk::ImageToVTKImageFilter<VisualizingImageType> itkVtkConverter;<br>        itkVtkConverter::Pointer conv=itkVtkConverter::New();<br>        conv->GetExporter()->SetInput(reader->GetOutput());<br>        conv->GetImporter()->Update();<br>        conv->GetImporter()->GetOutput()->Print(std::cout);<br><br>        vtkImageViewer * viewer =vtkImageViewer::New();<br>        vtkRenderWindowInteractor * renderWindowInteractor =<br>        vtkRenderWindowInteractor::New();<br>        viewer->SetupInteractor( renderWindowInteractor );<br>        viewer->SetInputData( conv->GetImporter()->GetOutput() );<br>        viewer->SetZSlice( 0 ); // <-- Slice selection<br>        viewer->Render();<br>        renderWindowInteractor->Start();<br><br>        viewer->Delete();<br>        renderWindowInteractor->Delete();<br>        conv->GetImporter()->Delete();<br><br><br>Thank you for your help<br><br>Roman<br>
</blockquote></div></div>
</div>
                        
                
                <base target="_self" href="https://e.mail.ru/">
        </div>

        
</div>


</div>
</blockquote>
<br></BODY></HTML>