<div dir="ltr">Hello Everyone:<br><br>    I am a Beginner using VTK for DICOM Image application, I successfully read the DICOM Image by vtkDICOMReader, I tried to find out the 3D rendering methods: MarchingCubes, I just copy the codes on the example and change the Directory Folder to in which my DICOM Files are saved, and it ended up to an error(as the snapshot_1), here is my code:<br><br><div>    I really want to realize where the error comes from, since it's similar as the least one, is there some knowledge I should take care before using VTK libraries? Also do you recommend the other 3D reconstruction methods?</div><div><br><br><div>#include <vtkVersion.h></div><div>#include <vtkSmartPointer.h></div><div>#include <vtkMarchingCubes.h></div><div>#include <vtkVoxelModeller.h></div><div>#include <vtkSphereSource.h></div><div>#include <vtkImageData.h></div><div>#include <vtkDICOMImageReader.h></div><div>#include <vtkActor.h></div><div>#include <vtkPolyDataMapper.h></div><div>#include <vtkRenderWindowInteractor.h></div><div>#include <vtkRenderWindow.h></div><div>#include <vtkRenderer.h></div><div><br></div><div>#include <vtkAutoInit.h></div><div>#include <vtkInteractionStyleModule.h></div><div>#include <vtkInteractionStyleObjectFactory.h></div><div>#include <vtkRenderingOpenGL2Module.h></div><div>#include <vtkRenderingOpenGL2ObjectFactory.h></div><div>#include <vtkInteractionStyleModule.h></div><div>#include <vtkInteractionStyleObjectFactory.h></div><div>VTK_MODULE_INIT(vtkRenderingOpenGL2);</div><div>VTK_MODULE_INIT(vtkRenderingFreeType);</div><div>VTK_MODULE_INIT(vtkInteractionStyle);<br><br></div></div><div>int main(int argc, char *argv[])</div><div>{</div><div><span class="" style="white-space:pre">   </span>vtkSmartPointer<vtkImageData> volume =</div><div><span class="" style="white-space:pre">               </span>vtkSmartPointer<vtkImageData>::New();</div><div><span class="" style="white-space:pre">        </span>double isoValue;</div><div><br></div><div><span class="" style="white-space:pre">          </span>vtkSmartPointer<vtkDICOMImageReader> reader =</div><div><span class="" style="white-space:pre">                        </span>vtkSmartPointer<vtkDICOMImageReader>::New();</div><div><span class="" style="white-space:pre">         </span>reader->SetDirectoryName("D:/Ralf/VTK/DICOM/case2009.04.15.12.07.26/MR");</div><div><span class="" style="white-space:pre">             </span>reader->Update();</div><div><span class="" style="white-space:pre">               </span>volume->DeepCopy(reader->GetOutput());</div><div><span class="" style="white-space:pre">               </span>isoValue = atof(argv[2]);</div><div><span class="" style="white-space:pre">  </span></div><div><br></div><div><span class="" style="white-space:pre">  </span>vtkSmartPointer<vtkMarchingCubes> surface =</div><div><span class="" style="white-space:pre">          </span>vtkSmartPointer<vtkMarchingCubes>::New();</div><div><br></div><div>#if VTK_MAJOR_VERSION <= 5</div><div><span class="" style="white-space:pre">       </span>surface->SetInput(volume);</div><div>#else</div><div><span class="" style="white-space:pre">  </span>surface->SetInputData(volume);</div><div>#endif</div><div><span class="" style="white-space:pre">     </span>surface->ComputeNormalsOn();</div><div><span class="" style="white-space:pre">    </span>surface->SetValue(0, isoValue);</div><div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer<vtkRenderer> renderer =</div><div><span class="" style="white-space:pre">              </span>vtkSmartPointer<vtkRenderer>::New();</div><div><span class="" style="white-space:pre"> </span>renderer->SetBackground(.1, .2, .3);</div><div><br></div><div><span class="" style="white-space:pre">   </span>vtkSmartPointer<vtkRenderWindow> renderWindow =</div><div><span class="" style="white-space:pre">              </span>vtkSmartPointer<vtkRenderWindow>::New();</div><div><span class="" style="white-space:pre">     </span>renderWindow->AddRenderer(renderer);</div><div><span class="" style="white-space:pre">    </span>vtkSmartPointer<vtkRenderWindowInteractor> interactor =</div><div><span class="" style="white-space:pre">              </span>vtkSmartPointer<vtkRenderWindowInteractor>::New();</div><div><span class="" style="white-space:pre">   </span>interactor->SetRenderWindow(renderWindow);</div><div><br></div><div><span class="" style="white-space:pre">     </span>vtkSmartPointer<vtkPolyDataMapper> mapper =</div><div><span class="" style="white-space:pre">          </span>vtkSmartPointer<vtkPolyDataMapper>::New();</div><div><span class="" style="white-space:pre">   </span>mapper->SetInputConnection(surface->GetOutputPort());</div><div><span class="" style="white-space:pre">        </span>mapper->ScalarVisibilityOff();</div><div><br></div><div><span class="" style="white-space:pre"> </span>vtkSmartPointer<vtkActor> actor =</div><div><span class="" style="white-space:pre">            </span>vtkSmartPointer<vtkActor>::New();</div><div><span class="" style="white-space:pre">    </span>actor->SetMapper(mapper);</div><div><br></div><div><span class="" style="white-space:pre">      </span>renderer->AddActor(actor);</div><div><br></div><div><span class="" style="white-space:pre">     </span>renderWindow->Render();</div><div><span class="" style="white-space:pre"> </span>interactor->Start();</div><div><span class="" style="white-space:pre">    </span>return EXIT_SUCCESS;</div><div>}<br><br><br>                                                              Sincerely, Ralf.</div></div>