[vtkusers] Dicom Image reader
Miguel Ángel Rodríguez Florido
marf at itccanarias.org
Sat Apr 4 08:08:43 EDT 2009
Perhaps, you have a compressed dicom file. I got this error for that.
Hth.
Sent from my iPhone
On 4 Apr 2009, at 12:16, JOHN ATKINSON <johnimager at gmail.com> wrote:
> Hi all,
>
> I have a CT Dicom data set of brain .I want view the volume data set
> in VTK .I used DICOM Image Reader but there is a error stating that
> vtkDicomImageReader.cxx line 284 No memory allocated to image
> data .Please Help
>
> My code:
>
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkActor.h"
> #include "vtkOutlineFilter.h"
> #include "vtkCamera.h"
> #include "vtkProperty.h"
> #include "vtkPolyDataNormals.h"
> #include "vtkContourFilter.h"
> #include "vtkDICOMImageReader.h"
> #include "vtkImageCast.h"
> #include "vtkImageActor.h"
> int main (int argc, char **argv)
> {
> // if (argc < 2)
> // {
> // cout << "Usage: " << argv[0] << " DATADIR/headsq/quarter" <<
> endl;
> // return 1;
> // }
> ///*Renderer and Render Window*/
> //vtkRenderer *aRenderer = vtkRenderer::New();
> // vtkRenderWindow *renWin = vtkRenderWindow::New();
> // renWin->AddRenderer(aRenderer);
> // vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New
> ();
> // iren->SetRenderWindow(renWin
>
> vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
>
> reader->SetFileName(argv[1]);
>
> vtkImageCast *cast = vtkImageCast::New();
> cast->SetInputConnection(reader->GetOutputPort());
> cast->SetOutputScalarTypeToUnsignedChar();
>
> vtkImageActor *actor = vtkImageActor::New();
> actor->SetInput(cast->GetOutput());
>
> vtkRenderer *render = vtkRenderer::New();
> render->AddActor(actor);
> render->ResetCamera();
>
> vtkRenderWindow *window = vtkRenderWindow::New();
> window->AddRenderer(render);
>
> window->Render();
> }
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list