[vtkusers] (no subject)

Naoyuki Kimura forzakim at yahoo.co.jp
Mon Dec 3 02:24:00 EST 2001


Dear sirs

I am going to do volume rendering from BMP slice images,
but a result is undesirable.
A result enlarges part of volume.
Will there be an insufficient parameter?
Please teach to me.

    vtkBMPReader *reader = vtkBMPReader::New();
    reader->SetDataExtent(0, 511, 0, 511, 1, 234);
   
reader->SetFilePrefix("../ImplicitVolumeData/NOMURA_FemurBmp");
    reader->SetDataSpacing(0.67, 0.67, 2.0);
    reader->SetDataOrigin(0, -343.04, 45.0);
    reader->SetTransform(pa);
    reader->Update();

    vtkPiecewiseFunction *opacityTransferFunction =
vtkPiecewiseFunction::New();
    opacityTransferFunction->AddPoint(60.0, 0.0);
    opacityTransferFunction->AddPoint(200.0, 1.0);
    opacityTransferFunction->ClampingOff();

    vtkVolumeProperty *volumeProperty =
vtkVolumeProperty::New();
   
volumeProperty->SetScalarOpacity(opacityTransferFunction);
    volumeProperty->SetInterpolationTypeToLinear();
    volumeProperty->ShadeOn();

    vtkVolumeRayCastCompositeFunction *compositeFunction =
vtkVolumeRayCastCompositeFunction::New();

    vtkVolumeRayCastMapper *volumeMapper =
vtkVolumeRayCastMapper::New();
    volumeMapper->SetInput(reader->GetOutput());
   
volumeMapper->SetVolumeRayCastFunction(compositeFunction);

    vtkVolume *volume = vtkVolume::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);

Regards

forzakim

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/




More information about the vtkusers mailing list