1. 程式人生 > >vtk獲取記憶體中影象資料

vtk獲取記憶體中影象資料

    vtkImageImport *importer = vtkImageImport::New();
    importer->SetWholeExtent( 0, m_image->width-1, 0, m_image->height-1, 0, 0 );
    importer->SetDataExtentToWholeExtent();
    importer->SetDataScalarTypeToUnsignedChar();
    importer->SetNumberOfScalarComponents(m_image->depth);
    importer->SetImportVoidPointer(m_image->data);