[vtkusers] vtkIdTypeArray [00A8FD90]: Unable to allocate 131072000 elements of size

Chasan KIOUTSOUKMOUSTAFA chasank at yahoo.com
Thu Aug 19 14:20:56 EDT 2010


I want to show saggital side of a CT from a dicom folder. I've three Dicom folder to test the project. Two of them are working ( 35KB * 488 dicom files and 35KB * 341 dicom files) but the last one ( 515KB * 250 dicom files) gives runtime error such that;

ERROR: In c:\vtk\common\vtkDataArrayTemplate.txx, line 142
vtkIdTypeArray [00A8FD90]: Unable to allocate 131072000 elements of size

what can be the solution ?

Dicom()
    {
        reader = vtkDICOMImageReader::New();
        viewer = vtkImageViewer::New();
        iren = vtkRenderWindowInteractor::New();
        saggital = vtkImageDataGeometryFilter::New();
        coronal = vtkImageDataGeometryFilter::New();
        axial = vtkImageDataGeometryFilter::New();
        saggitalMapper = vtkPolyDataMapper::New();
        saggitalActor = vtkActor::New();
        saggitalRenderer = vtkRenderer::New();
        saggitalRenWin = vtkRenderWindow::New();
        saggitalIren = vtkRenderWindowInteractor::New();
        saggitalCam = vtkCamera::New();

    }

    // To Show saggital axis of CT
    void ReadDICOMFolder(string DICOMFolder)
    {
        viewer->SetInput(reader->GetOutput());
        reader->SetDirectoryName(DICOMFolder.c_str());
        reader->Update();

        saggital->SetInputConnection(reader->GetOutputPort());

        saggitalMapper->SetInput(saggital->GetOutput());
        saggitalMapper->ScalarVisibilityOn();
        saggitalMapper->SetScalarRange(1450, 2450);

        saggitalActor->SetMapper(saggitalMapper);

        saggitalRenderer->AddActor(saggitalActor);
        saggitalRenWin->AddRenderer(saggitalRenderer);
        saggitalIren->SetRenderWindow(saggitalRenWin);
        saggitalIren->SetSize(640, 480);

        saggitalCam->SetViewUp(0, 0, -1);
        saggitalCam->SetPosition(1, 0, 0);
        saggitalCam->SetFocalPoint(0, 0, 0);
        saggitalCam->ComputeViewPlaneNormal();

        saggitalRenderer->SetActiveCamera(saggitalCam);
        saggitalRenderer->ResetCamera();
        saggitalRenderer->SetBackground(0, 0, 0);

        int dataExtent[6];

        reader->GetDataExtent(dataExtent);

        for(int i = 0; i <= dataExtent[1]; i++)
        {
            saggital->SetExtent(i, i, 0, dataExtent[3], 0, dataExtent[5]);
            saggitalRenderer->ResetCamera();
            saggitalRenWin->Render();
        }            
   }



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100819/41bd81c4/attachment.htm>


More information about the vtkusers mailing list