[vtkusers] about the BMP slice Read & 3D Rendering.
Marcelo Costa Oliveira
marcelo at radioimaging.net
Mon Oct 7 08:23:21 EDT 2002
Hi Yan,
I never worked with BMP slice just DICOM,
Try change iso->SetValue(0,1150) to other values
----- Original Message -----
From: "#YAN RI AN#" <PS7278514B at ntu.edu.sg>
To: "Vtkusers (E-mail)" <vtkusers at public.kitware.com>
Sent: Saturday, October 05, 2002 2:14 AM
Subject: [vtkusers] about the BMP slice Read & 3D Rendering.
>
> Dear VTK-Users:
> I meet the problem when I read a stack of 512x512x256 BMP file.
> I used the vtkImageReader class instead of vtkVolume16Reader class because
It was not a 16 bit image format.
> I could not get the correct rendering of each organ such as only the
rendering of the bone in the BMP slice.
>
> Here is my source code:
>
> vtkImageReader *reader=vtkImageReader::New();
> reader->SetFilePrefix("g:/00head/h");
> reader->SetDataByteOrderToLittleEndian();
> reader->SetDataExtent(0,100,0,100,1,12);
> reader->SetDataSpacing(1,1,0.5);
> reader->SetDataMask(0x7ff);
>
> vtkMarchingContourFilter *iso=vtkMarchingContourFilter::New();
> iso->SetInput(reader->GetOutput());
> iso->SetValue(0,1150);
>
> vtkPolyDataMapper *isoMapper=vtkPolyDataMapper::New();
> isoMapper->SetInput(iso->GetOutput());
> isoMapper->ScalarVisibilityOff();
>
>
> vtkActor *isoActor=vtkActor::New();
> isoActor->SetMapper(isoMapper);
> isoActor->GetProperty()->SetColor(1,1,1);
>
> vtkRenderer *ren1 = vtkRenderer::New();
> ren1->AddActor(isoActor);
> ren1->SetBackground(0.2,0.3,0.5);
>
> vtkRenderWindow *renWin = vtkRenderWindow::New();
> renWin->AddRenderer(ren1);
> renWin->SetSize(600,600);
>
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> iren->SetRenderWindow(renWin);
>
>
> renWin->Render();
> iren->Start();
>
> How could I do?
> ***************************************
> * Best Regards
> * Yan Rian (Research Student)
> * Email : ps7278514b at ntu.edu.sg
> * Lab : AMRC Research Centre
> * Nanyang Technological University
> * Singapore
> ***************************************
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list