<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1518530601371_66356"><span id="yui_3_16_0_ym19_1_1518530601371_66427">Dear All,<br></span></div><div id="yui_3_16_0_ym19_1_1518530601371_66425"><span><br></span></div><div id="yui_3_16_0_ym19_1_1518530601371_66437" dir="ltr"><span id="yui_3_16_0_ym19_1_1518530601371_66493">I read some DICOM data using vtkGDCMImageReader, then I change the sapacing and reslice them. Next I want to change that vtk image to itk image to be able to apply noise removal. But as soon as the code reaches the "filter_toitkimage->Update();" line the program just exits without saying anything (actually it says:The program '[14040] QtGuiApplication2.exe' has exited with code 3 (0x3).).</span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1518530601371_68538"><span id="yui_3_16_0_ym19_1_1518530601371_66493"><br></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1518530601371_68537"><span id="yui_3_16_0_ym19_1_1518530601371_66493">Here is the code:</span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1518530601371_66607"><span id="yui_3_16_0_ym19_1_1518530601371_66493"><br></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1518530601371_66585"><span id="yui_3_16_0_ym19_1_1518530601371_66493">vtkSmartPointer<vtkGDCMImageReader> reader = vtkSmartPointer<vtkGDCMImageReader>::New();<br id="yui_3_16_0_ym19_1_1518530601371_66667"> reader->SetFileNames(vtkfiles);<br id="yui_3_16_0_ym19_1_1518530601371_66668"> reader->Update();<br id="yui_3_16_0_ym19_1_1518530601371_66669"> <br id="yui_3_16_0_ym19_1_1518530601371_66670"> vtkSmartPointer<vtkImageChangeInformation> changer = vtkSmartPointer<vtkImageChangeInformation>::New();<br id="yui_3_16_0_ym19_1_1518530601371_66671"> changer->SetOutputSpacing(pixlespacing, pixlespacing, ippzspacing);//@majidnow<br id="yui_3_16_0_ym19_1_1518530601371_66672"> changer->SetInputConnection(reader->GetOutputPort());<br id="yui_3_16_0_ym19_1_1518530601371_66673"><br id="yui_3_16_0_ym19_1_1518530601371_66674"> vtkSmartPointer<vtkImageReslice> reslice = vtkSmartPointer<vtkImageReslice>::New();<br id="yui_3_16_0_ym19_1_1518530601371_66675"> reslice->SetInputConnection(changer->GetOutputPort());<br id="yui_3_16_0_ym19_1_1518530601371_66676"> <br id="yui_3_16_0_ym19_1_1518530601371_66677"> //to change VTK image to ITK image<br id="yui_3_16_0_ym19_1_1518530601371_66678"> const unsigned int Dimension = 3;<br id="yui_3_16_0_ym19_1_1518530601371_66679"><br id="yui_3_16_0_ym19_1_1518530601371_66680"> using PixelType = double;<br id="yui_3_16_0_ym19_1_1518530601371_66681"> using ImageType = itk::Image< PixelType, Dimension >;<br id="yui_3_16_0_ym19_1_1518530601371_66682"><br id="yui_3_16_0_ym19_1_1518530601371_66683"> using FilterType = itk::VTKImageToImageFilter< ImageType >;<br id="yui_3_16_0_ym19_1_1518530601371_66684"> FilterType::Pointer filter_toitkimage = FilterType::New();<br id="yui_3_16_0_ym19_1_1518530601371_66685"> filter_toitkimage->SetInput(reslice->GetOutput());<br id="yui_3_16_0_ym19_1_1518530601371_66686"><br id="yui_3_16_0_ym19_1_1518530601371_66687"> try<br id="yui_3_16_0_ym19_1_1518530601371_66688"> {<br id="yui_3_16_0_ym19_1_1518530601371_66689"> filter_toitkimage->Update();<br id="yui_3_16_0_ym19_1_1518530601371_66690"> }<br id="yui_3_16_0_ym19_1_1518530601371_66691"> catch (itk::ExceptionObject & error)<br id="yui_3_16_0_ym19_1_1518530601371_66692"> {<br id="yui_3_16_0_ym19_1_1518530601371_66693"> std::cerr << "Error: " << error << std::endl;<br id="yui_3_16_0_ym19_1_1518530601371_66694"> //return EXIT_FAILURE;<br id="yui_3_16_0_ym19_1_1518530601371_66695"> }</span></div><div id="yui_3_16_0_ym19_1_1518530601371_66355"><div> </div><div><br></div><div>Any idea why this happens?<br></div></div><div class="signature" id="yui_3_16_0_ym19_1_1518530601371_66350"><br></div></div></body></html>