<HTML><BODY><br>

<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div>
                <base target="_self" href="https://e.mail.ru/">
                
                        <div id="style_13987600550000000876;0;1_BODY">
I change the part of my programm to load the ImageSeries,<br><div><div><div><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>
        



    









        
        


        
        
        
        
        

        
        

        
        



<div>
        
        <div>
                
                
                        <div><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>
                        
                
                
        </div>

        
</div>


</div>
</blockquote>
<br>

</div>
                        <div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</div>
                
                
        </div>

        
</div>



<br><hr>
</div>
                        
                
                <base target="_self" href="https://e.mail.ru/">
        </div>

        
</div>



<br><hr>
<br>-- <br>Роман Глуховский<br></BODY></HTML>